Working without jQuery

This commit is contained in:
Kasper Rynning-Tønnesen
2018-04-25 23:19:49 +02:00
parent 8cb8c46f2f
commit 15eeb3cc60
12 changed files with 183 additions and 137 deletions

View File

@@ -35,19 +35,15 @@ window.addEventListener("DOMContentLoaded", function (){
function handleEvent(e, target, tried, type) {
//console.log(target, dynamicListeners);
//console.log(e.path, target);
for(var y = 0; y < e.path.length; y++) {
var target = e.path[y];
if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) {
//console.log(target.id);
dynamicListeners[type]["#" + target.id].call(target);
return;
} else {
if(target.classList == undefined) return;
for(var i = 0; i < target.classList.length; i++) {
if(dynamicListeners[type] && dynamicListeners[type]["." + target.classList[i]]) {
//console.log(target.id);
dynamicListeners[type]["." + target.classList[i]].call(target);
return;
}