ported to static site, removed _ext folder, split hbs files into partials

This commit is contained in:
skeddles
2021-07-06 17:24:20 -04:00
parent 1e3549b016
commit 1f820fd97e
86 changed files with 1203 additions and 977 deletions

22
js/util/on.js Normal file
View File

@@ -0,0 +1,22 @@
//add event listener for any element which calls a function
//element can be provided as a direct reference or with just a string of the name
function on(event, elementId, functionCallback) {
//if element provided is string, get the actual element
var element = (typeof elementId == 'string' ? document.getElementById(elementId) : elementId);
//console.log('added '+event+' event listener on '+element)
element.addEventListener(event,
function (e) {
// e = event
//this = element clicked
functionCallback(e, this);
//if you need to access the event or this variable, you need to add them
//when you define the callback, but you cant use the word this, eg:
//on('click', menuButton, function (e, button) {});
});
}