From a525aeb86aaa02bccf960c18ee0b6751409e7d70 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 20 May 2020 11:34:46 +0300 Subject: Fix userlist saving, revert options panel --- res/client.js | 21 +++++++-------------- res/css/des.css | 14 +++++--------- res/index.html | 11 +++-------- src/client/Buttons.hx | 20 ++++++-------------- src/client/Main.hx | 4 +--- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/res/client.js b/res/client.js index f7cf45c..0ab736c 100644 --- a/res/client.js +++ b/res/client.js @@ -472,17 +472,16 @@ client_Buttons.init = function(main) { var userlistToggle = window.document.querySelector("#userlisttoggle"); userlistToggle.onclick = function(e) { var icon = userlistToggle.firstElementChild; - var isHidden = userlistToggle.classList.toggle("chevron-right"); - userlistToggle.classList.toggle("chevron-down"); + var isHidden = icon.getAttribute("name") == "chevron-forward"; var style = window.document.querySelector("#userlist").style; if(isHidden) { - style.display = "none"; - icon.setAttribute("name","chevron-forward"); - } else { style.display = "block"; icon.setAttribute("name","chevron-down"); + } else { + style.display = "none"; + icon.setAttribute("name","chevron-forward"); } - client_Buttons.settings.isUserListHidden = isHidden; + client_Buttons.settings.isUserListHidden = !isHidden; client_Settings.write(client_Buttons.settings); }; window.document.querySelector("#usercount").onclick = userlistToggle.onclick; @@ -553,11 +552,7 @@ client_Buttons.init = function(main) { }; var showOptions = window.document.querySelector("#showoptions"); showOptions.onclick = function(e) { - var isActive = client_Buttons.toggleGroup(showOptions); - window.document.querySelector("#messagebuffer").style.display = isActive ? "none" : "block"; - window.document.querySelector("#chatbox").style.display = isActive ? "none" : "flex"; - window.document.querySelector("#userlisttoggle").style.display = isActive ? "none" : "inline-flex"; - return window.document.querySelector("#optionsTitle").style.display = isActive ? "inline-flex" : "none"; + return client_Buttons.toggleGroup(showOptions); }; window.document.querySelector("#exitBtn").onclick = function(e) { if((main.personal.group & 1) != 0) { @@ -1404,7 +1399,6 @@ client_Main.prototype = { window.document.querySelector("#guestpassword").style.display = "none"; window.document.querySelector("#chatbox").style.display = "none"; window.document.querySelector("#exitBtn").textContent = Lang.get("login"); - window.dispatchEvent(new Event("resize")); } ,hideGuestLoginPanel: function() { window.document.querySelector("#guestlogin").style.display = "none"; @@ -1412,9 +1406,8 @@ client_Main.prototype = { window.document.querySelector("#chatbox").style.display = "flex"; window.document.querySelector("#exitBtn").textContent = Lang.get("exit"); if((this.personal.group & 4) != 0) { - window.document.querySelector("#clearchatbtn").style.display = "inline-block"; + window.document.querySelector("#adminMenu").style.display = "block"; } - window.dispatchEvent(new Event("resize")); } ,showGuestPasswordPanel: function() { window.document.querySelector("#guestlogin").style.display = "none"; diff --git a/res/css/des.css b/res/css/des.css index 73a937f..69cf6e8 100644 --- a/res/css/des.css +++ b/res/css/des.css @@ -487,19 +487,15 @@ footer#footer { /* Options */ -#optionsTitle { - display: inline-flex; - line-height: 1; - padding: .5rem; - align-items: center; - text-align: center; - margin-left: .5rem; -} - #optionsPanel { z-index: 1; background-color: var(--background-chat); overflow-y: scroll; + position: absolute; + top: 3rem; + left: 1rem; + bottom: 1rem; + right: 1rem; scrollbar-color: var(--border) var(--background-chat); scrollbar-width: thin; } diff --git a/res/index.html b/res/index.html index 61944a7..074c283 100644 --- a/res/index.html +++ b/res/index.html @@ -99,9 +99,8 @@