miniflux/ui/static/js/mouse_handler.js

11 lines
343 B
JavaScript
Raw Normal View History

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