
export default class Events {
    static initialiseEventHandler(selectorElement, classInitialised, eventHandler) {
        document.querySelectorAll(selectorElement).forEach(function(element) {
            if (element.classList.contains(classInitialised)) return;
            eventHandler(element);
            element.classList.add(classInitialised);
        });
    }
    static hookupEventHandler(eventType, selector, callback) {
        Events.initialiseEventHandler(selector, flagInitialised, (element) => {
            element.addEventListener(eventType, (event) => {
                event.stopPropagation();
                callback(event, element);
            });
        });
    }
}