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 709B

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