miniflux/ui/static/js/mouse_handler.js

14 lines
388 B
JavaScript
Raw Normal View History

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