summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-01-11 14:15:41 +0100
committerGitHub <noreply@github.com>2022-01-11 14:15:41 +0100
commit2e61727e96883a9b8a1e80b4b59c7ae5e4ce2c78 (patch)
treeabae7dd77a48bfc1678b8e673787b3d84e366220 /core
parent89504e1aed6491570c2aa56b910bf35a00935be7 (diff)
parent97a938fe9fc712c4104b0646ac31195d1a085984 (diff)
downloadnextcloud-server-2e61727e96883a9b8a1e80b4b59c7ae5e4ce2c78.tar.gz
nextcloud-server-2e61727e96883a9b8a1e80b4b59c7ae5e4ce2c78.zip
Merge pull request #30590 from nextcloud/backport/30571/stable21
[stable21] fix: only use jquery once it is available
Diffstat (limited to 'core')
-rw-r--r--core/js/public/publicpage.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/js/public/publicpage.js b/core/js/public/publicpage.js
index f74cba669ed..7cca96e1d01 100644
--- a/core/js/public/publicpage.js
+++ b/core/js/public/publicpage.js
@@ -31,16 +31,17 @@ window.addEventListener('DOMContentLoaded', function () {
$('#remote_address').focus();
});
-});
-$(document).mouseup(function(e) {
- var toggle = $('#body-public').find('.header-right .menutoggle');
- var container = toggle.next('.popovermenu');
+ $(document).mouseup(function(e) {
+ var toggle = $('#body-public').find('.header-right .menutoggle');
+ var container = toggle.next('.popovermenu');
+
+ // if the target of the click isn't the menu toggle, nor a descendant of the
+ // menu toggle, nor the container nor a descendant of the container
+ if (!toggle.is(e.target) && toggle.has(e.target).length === 0 &&
+ !container.is(e.target) && container.has(e.target).length === 0) {
+ container.removeClass('open');
+ }
+ });
- // if the target of the click isn't the menu toggle, nor a descendant of the
- // menu toggle, nor the container nor a descendant of the container
- if (!toggle.is(e.target) && toggle.has(e.target).length === 0 &&
- !container.is(e.target) && container.has(e.target).length === 0) {
- container.removeClass('open');
- }
});