From bd2907c13f6d9fe3c6d5f409a090cd2feb94490f Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 23 Feb 2018 21:22:05 +0200 Subject: [PATCH] Use document.body when wrapping it in a jquery object --- client/js/lounge.js | 2 +- client/js/socket-events/init.js | 2 +- client/js/utils.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index 439ba567..80d59cdf 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -613,7 +613,7 @@ $(function() { container.html(templates.user_filtered({matches: result})).show(); }); - if ($("body").hasClass("public") && (window.location.hash === "#connect" || window.location.hash === "")) { + if ($(document.body).hasClass("public") && (window.location.hash === "#connect" || window.location.hash === "")) { $("#connect").one("show", function() { const params = URI(document.location.search).search(true); diff --git a/client/js/socket-events/init.js b/client/js/socket-events/init.js index f2cd9fc1..62db7565 100644 --- a/client/js/socket-events/init.js +++ b/client/js/socket-events/init.js @@ -41,7 +41,7 @@ socket.on("init", function(data) { webpush.configurePushNotifications(data.pushSubscription, data.applicationServerKey); - $("body").removeClass("signed-out"); + $(document.body).removeClass("signed-out"); $("#loading").remove(); $("#sign-in").remove(); diff --git a/client/js/utils.js b/client/js/utils.js index 666e239c..ea1574a5 100644 --- a/client/js/utils.js +++ b/client/js/utils.js @@ -109,7 +109,7 @@ function toggleNotificationMarkers(newState) { } function confirmExit() { - if ($("body").hasClass("public")) { + if ($(document.body).hasClass("public")) { window.onbeforeunload = function() { return "Are you sure you want to navigate away from this page?"; };