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.

scroll.js 876B

1234567891011121314151617181920212223242526272829303132
  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. var target = binding.arg ? document.querySelector(binding.arg) : window;
  9. if (!target) return;
  10. target.addEventListener('scroll', callback, options);
  11. el._onScroll = {
  12. callback: callback,
  13. options: options,
  14. target: target
  15. };
  16. }
  17. function unbind(el) {
  18. if (!el._onScroll) return;
  19. var _el$_onScroll = el._onScroll,
  20. callback = _el$_onScroll.callback,
  21. options = _el$_onScroll.options,
  22. target = _el$_onScroll.target;
  23. target.removeEventListener('scroll', callback, options);
  24. delete el._onScroll;
  25. }
  26. exports.default = {
  27. inserted: inserted,
  28. unbind: unbind
  29. };
  30. //# sourceMappingURL=scroll.js.map