Update tag.html

This commit is contained in:
Meekdai 2024-04-02 18:07:39 +08:00
parent ddad57bc46
commit 9def4814f9

View File

@ -90,9 +90,8 @@ function showList(){
showLabels.setAttribute("onclick","javascript:updateShowTag('All');"); showLabels.setAttribute("onclick","javascript:updateShowTag('All');");
tagLable.appendChild(showLabels); tagLable.appendChild(showLabels);
} }
for(i in jsonData){
for(label of jsonData[i]['labels']){ for(label of jsonData['labelColorDict']){
if(!(tagList.includes(label))){
tagList.push(label); tagList.push(label);
let showLabels=document.createElement("button"); let showLabels=document.createElement("button");
showLabels.setAttribute("class","Label"); showLabels.setAttribute("class","Label");
@ -101,8 +100,9 @@ function showList(){
showLabels.setAttribute("onclick","javascript:updateShowTag('"+label+"');"); showLabels.setAttribute("onclick","javascript:updateShowTag('"+label+"');");
tagLable.appendChild(showLabels); tagLable.appendChild(showLabels);
} }
}
for(i in jsonData){
if(i!='labelColorDict'){
let div=document.createElement("div"); let div=document.createElement("div");
div.setAttribute("class","lists "+jsonData[i]['label']); div.setAttribute("class","lists "+jsonData[i]['label']);
let item=document.createElement("a"); let item=document.createElement("a");
@ -148,6 +148,7 @@ function showList(){
SideNav.appendChild(div); SideNav.appendChild(div);
} }
} }
}
function updateShowTag(label){ function updateShowTag(label){
if(window.location.hash.slice(1)!=encodeURI(label)){ if(window.location.hash.slice(1)!=encodeURI(label)){