From: Art Cancro Date: Thu, 17 Feb 2022 00:41:50 +0000 (-0500) Subject: The sidebar buttons are now unhighlighted by default. When rendering a room view... X-Git-Tag: v950~10 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=15251e3508ee3096309295ed94aa88755053a615;p=citadel.git The sidebar buttons are now unhighlighted by default. When rendering a room view, iterate through all of them, unhighlight any that are highlighted, and then highlight the correct one. --- diff --git a/webcit-ng/static/index.html b/webcit-ng/static/index.html index f87f5f7bf..3344f177b 100644 --- a/webcit-ng/static/index.html +++ b/webcit-ng/static/index.html @@ -53,16 +53,16 @@ LOADING
-
+ diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index cfdca07ba..7fb8b8a4b 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -18,8 +18,17 @@ function render_room_view(gt_msg, lt_msg) { document.getElementById("ctdl-newmsg-button").style.display = "none"; // the view renderer will set this + // Clear the highlighting out of all the sidebar buttons + var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*"); + for (var i = items.length; i--;) { + if (items[i].id.includes("ctdl-sidebar-button-")) { + items[i].classList.remove("w3-blue"); + } + } + switch(current_view) { case views.VIEW_BBS: + document.getElementById("ctdl-sidebar-button-forums").classList.add("w3-blue"); document.getElementById("ctdl-main").innerHTML = "
"; forum_readmessages("ctdl-mrp", gt_msg, lt_msg); break;