mirror of
https://codeberg.org/claui/mobile-config-firefox.git
synced 2024-11-10 03:40:14 +00:00
Clear the code-block when switching categories
This commit is contained in:
parent
0705a8526d
commit
3f47e98a75
1 changed files with 10 additions and 0 deletions
|
@ -104,8 +104,18 @@ function getSecondaryCategories(list){
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearCodeBlock(){
|
||||||
|
const pre = document.getElementById("previewBox");
|
||||||
|
for(let el of Array.from(pre.childNodes)){
|
||||||
|
pre.remove(el)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
async function onCategoryClicked(categoryNode,isSecondary = false){
|
async function onCategoryClicked(categoryNode,isSecondary = false){
|
||||||
|
|
||||||
|
clearCodeBlock();
|
||||||
|
|
||||||
currentCategory.set(categoryNode,isSecondary);
|
currentCategory.set(categoryNode,isSecondary);
|
||||||
// Using textContent is bad but meh
|
// Using textContent is bad but meh
|
||||||
//let names = DB.query(categoryNode.textContent);
|
//let names = DB.query(categoryNode.textContent);
|
||||||
|
|
Loading…
Reference in a new issue