From 88365612dab2351b297c895952fa98b105894b4d Mon Sep 17 00:00:00 2001 From: Xaekai Date: Fri, 17 Apr 2020 14:53:39 -0700 Subject: [PATCH] Replace userlist visibility check logic (#859) * Replace visibility check logic JQuery queries using getComputedStyle, which makes it impossible to change userlist behavior using CSS. This replaces the check with a direct style="" value check so the JS does not trip up if any CSS customizations to the list visibility were made. Co-authored-by: Algoinde --- www/js/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/ui.js b/www/js/ui.js index 581b640b..2db2ea35 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -15,7 +15,7 @@ $(window).focus(CyTube.ui.onPageFocus).blur(CyTube.ui.onPageBlur); $(".modal").focus(CyTube.ui.onPageFocus); $("#togglemotd").click(function () { - var hidden = $("#motd").css("display") === "none"; + var hidden = $("#motd")[0].style.display === "none"; $("#motd").toggle(); if (hidden) { $("#togglemotd").find(".glyphicon-plus") @@ -817,7 +817,7 @@ $("#cs-emotes-import").click(function () { var toggleUserlist = function () { var direction = !USEROPTS.layout.match(/synchtube/) ? "glyphicon-chevron-right" : "glyphicon-chevron-left" - if ($("#userlist").css("display") === "none") { + if ($("#userlist")[0].style.display === "none") { $("#userlist").show(); $("#userlisttoggle").removeClass(direction).addClass("glyphicon-chevron-down"); } else {