Make event listeners passive
This commit is contained in:
parent
daea4cb084
commit
98649e1277
1 changed files with 5 additions and 5 deletions
|
@ -107,12 +107,12 @@ function getSecondaryCategories(list){
|
||||||
function clearCodeBlock(){
|
function clearCodeBlock(){
|
||||||
const pre = document.getElementById("previewBox");
|
const pre = document.getElementById("previewBox");
|
||||||
for(let el of Array.from(pre.childNodes)){
|
for(let el of Array.from(pre.childNodes)){
|
||||||
pre.remove(el)
|
pre.removeChild(el)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onCategoryClicked(categoryNode,isSecondary = false){
|
function onCategoryClicked(categoryNode,isSecondary = false){
|
||||||
|
|
||||||
clearCodeBlock();
|
clearCodeBlock();
|
||||||
|
|
||||||
|
@ -175,11 +175,11 @@ function createCategories(){
|
||||||
|
|
||||||
const CAT_PARENT = document.getElementById("categories");
|
const CAT_PARENT = document.getElementById("categories");
|
||||||
const CAT_SECOND = document.getElementById("secondaryCategories");
|
const CAT_SECOND = document.getElementById("secondaryCategories");
|
||||||
CAT_PARENT.addEventListener("click",onSomeClicked);
|
CAT_PARENT.addEventListener("click",onSomeClicked,{passive:true});
|
||||||
CAT_SECOND.addEventListener("click",onSomeClicked);
|
CAT_SECOND.addEventListener("click",onSomeClicked,{passive:true});
|
||||||
|
|
||||||
const TAR_PARENT = document.getElementById("targets");
|
const TAR_PARENT = document.getElementById("targets");
|
||||||
TAR_PARENT.addEventListener("click",onSomeClicked);
|
TAR_PARENT.addEventListener("click",onSomeClicked,{passive:true});
|
||||||
|
|
||||||
const createNode = function(name,type){
|
const createNode = function(name,type){
|
||||||
let node = document.createElement("div");
|
let node = document.createElement("div");
|
||||||
|
|
Loading…
Reference in a new issue