Sha256: 2a7736ade2d0fbbeedb816daa8b94eb917fe31fffd4fb78719d733f812981a3b

Contents?: true

Size: 386 Bytes

Versions: 53

Compression:

Stored size: 386 Bytes

Contents

export default hideOnEsc = {
  name: "hideOnEsc",

  defaultValue: true,

  fn({ hide }) {
    function onKeyDown(event) {
      if (event.keyCode === 27) {
        hide();
      }
    }

    return {
      onShow() {
        document.addEventListener("keydown", onKeyDown);
      },

      onHide() {
        document.removeEventListener("keydown", onKeyDown);
      },
    };
  },
};

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
coveragebook_components-0.16.0 app/assets/js/base/tippy/plugins/hide_on_esc.js
coveragebook_components-0.15.0 app/assets/js/base/tippy/plugins/hide_on_esc.js
coveragebook_components-0.14.0 app/assets/js/base/tippy/plugins/hide_on_esc.js
coveragebook_components-0.13.1 app/assets/js/base/tippy/plugins/hide_on_esc.js
coveragebook_components-0.13.0 app/assets/js/base/tippy/plugins/hide_on_esc.js
coveragebook_components-0.12.2 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.12.1 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.12.0 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.11.0 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.10.1.beta.2 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.10.1.beta.1 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.10.1.beta.0 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.10.0 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.9.1 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.9.0 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.8.9 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.8.8 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.8.7 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.8.6 app/assets/js/libs/tippy/plugins/hide_on_esc.js
coveragebook_components-0.8.5 app/assets/js/libs/tippy/plugins/hide_on_esc.js