diff options
-rw-r--r-- | apps/files_sharing/js/public.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 2142dec1218..ae19500080b 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -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'); } }); |