Merge pull request #7598 from nextcloud/fix-closing-menu-on-second-click-in-sharing-page

Fix closing menu on second click in sharing page
This commit is contained in:
Morris Jobke 2018-01-02 15:11:30 +01:00 committed by GitHub
commit 588b0085dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -434,10 +434,13 @@ $(document).ready(function () {
$(document).mouseup(function(e) {
var toggle = $('#share-menutoggle');
var container = $('#share-menu');
// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0) {
// 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');
}
});