diff options
Diffstat (limited to 'static/js/weabotxt.js')
-rw-r--r-- | static/js/weabotxt.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index ea060f8..2c93105 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -189,6 +189,17 @@ function listSort(e) { for (var j = 0; j < arr.length; j++) table.appendChild(arr[j]); } +function checkHidden() { + var hidp = localStorage.getItem("hid-p-"+board); + if (hidp) { + var hid = hidp.split("!"); + for (var i = 0; i < hid.length; i++) { + var post = document.getElementById("p"+hid[i]); + if (post) post.classList.add("hidden"); + } + } +} + function togglePost(e) { var post = e.parentElement; var pid = post.id.slice(1); @@ -295,14 +306,7 @@ document.addEventListener("DOMContentLoaded", function() { } } - var hidp = localStorage.getItem("hid-p-"+board); - if (hidp) { - var hid = hidp.split("!"); - for (var i = 0; i < hid.length; i++) { - var post = document.getElementById("p"+hid[i]); - if (post) post.classList.add("hidden"); - } - } + checkHidden(); }); document.addEventListener("click", function(e) { |