Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

resize.js 795B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. function inserted(el, binding) {
  6. var callback = binding.value;
  7. var options = binding.options || { passive: true };
  8. window.addEventListener('resize', callback, options);
  9. el._onResize = {
  10. callback: callback,
  11. options: options
  12. };
  13. if (!binding.modifiers || !binding.modifiers.quiet) {
  14. callback();
  15. }
  16. }
  17. function unbind(el) {
  18. if (!el._onResize) return;
  19. var _el$_onResize = el._onResize,
  20. callback = _el$_onResize.callback,
  21. options = _el$_onResize.options;
  22. window.removeEventListener('resize', callback, options);
  23. delete el._onResize;
  24. }
  25. exports.default = {
  26. inserted: inserted,
  27. unbind: unbind
  28. };
  29. //# sourceMappingURL=resize.js.map