Make event listeners passive

This commit is contained in:
MrOtherGuy 2020-09-04 10:23:55 +03:00
parent daea4cb084
commit 98649e1277

View file

@ -107,12 +107,12 @@ function getSecondaryCategories(list){
function clearCodeBlock(){
const pre = document.getElementById("previewBox");
for(let el of Array.from(pre.childNodes)){
pre.remove(el)
pre.removeChild(el)
}
return
}
async function onCategoryClicked(categoryNode,isSecondary = false){
function onCategoryClicked(categoryNode,isSecondary = false){
clearCodeBlock();
@ -175,11 +175,11 @@ function createCategories(){
const CAT_PARENT = document.getElementById("categories");
const CAT_SECOND = document.getElementById("secondaryCategories");
CAT_PARENT.addEventListener("click",onSomeClicked);
CAT_SECOND.addEventListener("click",onSomeClicked);
CAT_PARENT.addEventListener("click",onSomeClicked,{passive:true});
CAT_SECOND.addEventListener("click",onSomeClicked,{passive:true});
const TAR_PARENT = document.getElementById("targets");
TAR_PARENT.addEventListener("click",onSomeClicked);
TAR_PARENT.addEventListener("click",onSomeClicked,{passive:true});
const createNode = function(name,type){
let node = document.createElement("div");