All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.directives.resize.index.mjs Maven / Gradle / Ivy

// Types

function mounted(el, binding) {
  const handler = binding.value;
  const options = {
    passive: !binding.modifiers?.active
  };
  window.addEventListener('resize', handler, options);
  el._onResize = Object(el._onResize);
  el._onResize[binding.instance.$.uid] = {
    handler,
    options
  };
  if (!binding.modifiers?.quiet) {
    handler();
  }
}
function unmounted(el, binding) {
  if (!el._onResize?.[binding.instance.$.uid]) return;
  const {
    handler,
    options
  } = el._onResize[binding.instance.$.uid];
  window.removeEventListener('resize', handler, options);
  delete el._onResize[binding.instance.$.uid];
}
export const Resize = {
  mounted,
  unmounted
};
export default Resize;
//# sourceMappingURL=index.mjs.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy