Initial commit.
This commit is contained in:
10
static/js/lib/events.js
Normal file
10
static/js/lib/events.js
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
export default class Events {
|
||||
static initialiseEventHandler(selectorElement, classInitialised, eventHandler) {
|
||||
document.querySelectorAll(selectorElement).forEach(function(element) {
|
||||
if (element.classList.contains(classInitialised)) return;
|
||||
element.classList.add(classInitialised);
|
||||
eventHandler(element);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user