From c78698754387413c5300656dcd74a8a485a0fb4f Mon Sep 17 00:00:00 2001 From: Meekdai Date: Tue, 21 Nov 2023 22:39:15 +0800 Subject: [PATCH] Update tag.html --- templates/tag.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/tag.html b/templates/tag.html index b46bd6e..30b034a 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -91,7 +91,7 @@ function showList(jsonData,tag){ showLabels.setAttribute("class","Label"); showLabels.setAttribute("style","background-color:"+jsonData["postListJson"][i]['labelColor']); showLabels.innerHTML=jsonData["postListJson"][i]['label']; - showLabels.setAttribute("onclick",'javascript:updateShowTag('+jsonData["postListJson"][i]['label']+');'); + showLabels.setAttribute("onclick",'javascript:updateShowTag("'+jsonData["postListJson"][i]['label']+'");'); tagLable.appendChild(showLabels); } @@ -138,8 +138,11 @@ function showList(jsonData,tag){ } function updateShowTag(label){ - window.location.hash="#"+(label); - showList(jsonData,label); + if(window.location.hash.slice(1)!=encodeURI(label)){ + window.location.hash="#"+(label); + showList(jsonData,label); + } + }