1. Module bundling added to reduce server calls as each file was taking ~440 ms to load on public server.\n2. JavaScript lib files refactored with OOP for use with module bundling.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
|
||||
function initialiseEventHandler(selectorElement, classInitialised, eventHandler) {
|
||||
document.querySelectorAll(selectorElement).forEach(function(element) {
|
||||
if (element.classList.contains(classInitialised)) return;
|
||||
element.classList.add(classInitialised);
|
||||
eventHandler(element);
|
||||
});
|
||||
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