]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/static/js/views.js
Tightened up the padding around the room list and rendered it with the flexbox model...
[citadel.git] / webcit-ng / static / js / views.js
index 605b7317e68e7df6b51c87712e5e107cd838f5a4..0466f8ae1bfe96d47708ea058daaa76143c3e254 100644 (file)
@@ -4,32 +4,37 @@
 // disclosure are subject to the GNU General Public License v3.
 
 
-// This function is the dispatcher that determines the correct view for a room,
-// and calls the correct renderer.  Greater/Less than bounds are accepted.
-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
+// Clear the sidebar buttons of any style indicating that one is selected
+function clear_sidebar_selection() {
        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");
+                       items[i].classList.remove("ctdl-sidebar-button-selected");
                }
        }
+}
+
+
+// This function is the dispatcher that determines the correct view for a room,
+// and calls the correct renderer.  Greater/Less than bounds are accepted.
+function render_room_view(gt_msg, lt_msg) {
+
+       document.getElementById("ctdl-newmsg-button").style.display = "none";           // the view renderer will set this
+       clear_sidebar_selection();
 
        switch(current_view) {
 
                // The "forum" module displays rooms with the "VIEW_BBS" view as classic style web forums.
                case views.VIEW_BBS:
-                       document.getElementById("ctdl-sidebar-button-forums").classList.add("w3-blue");
+                       document.getElementById("ctdl-sidebar-button-forums").classList.add("ctdl-sidebar-button-selected");
                        document.getElementById("ctdl-main").innerHTML = "<div id=\"ctdl-mrp\" class=\"ctdl-forum-reading-pane\"></div>";
                        forum_readmessages("ctdl-mrp", gt_msg, lt_msg);
                        break;
 
                // The "mail" module displays rooms with the VIEW_MAILBOX view as a webmail program.
                case views.VIEW_MAILBOX:
-                       document.getElementById("ctdl-sidebar-button-mail").classList.add("w3-blue");
+                       document.getElementById("ctdl-sidebar-button-mail").classList.add("ctdl-sidebar-button-selected");
                        document.getElementById("ctdl-main").innerHTML = "";
                        mail_display();
                        break;