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 <algoinde@gmail.com>
This commit is contained in:
Xaekai 2020-04-17 14:53:39 -07:00 committed by GitHub
parent f2adbe18da
commit 88365612da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 {