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.

25 lines
641 B

11 months ago
import normalizeWheel from 'normalize-wheel-es';
import { isFirefox } from '../../utils/util.mjs';
const mousewheel = function(element, callback) {
if (element && element.addEventListener) {
const fn = function(event) {
const normalized = normalizeWheel(event);
callback && callback.apply(this, [event, normalized]);
};
if (isFirefox()) {
element.addEventListener("DOMMouseScroll", fn);
} else {
element.onmousewheel = fn;
}
}
};
const Mousewheel = {
beforeMount(el, binding) {
mousewheel(el, binding.value);
}
};
export { Mousewheel as default };
//# sourceMappingURL=index.mjs.map