miniflux/ui/static/js/mouse_handler.js
2018-10-08 18:49:15 -07:00

11 lines
No EOL
343 B
JavaScript

class MouseHandler {
onClick(selector, callback, noPreventDefault) {
let elements = document.querySelectorAll(selector);
elements.forEach((element) => {
element.onclick = (event) => {
noPreventDefault || event.preventDefault();
callback(event);
};
});
}
}