From 116cb58c3c47cbe88bed7f4d0dd7bb7cd703a714 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Sep 2017 18:02:14 +0200 Subject: Show and hide menu via Javascript, thanks @skjnldsv Signed-off-by: Jan-Christoph Borchardt --- apps/files_sharing/js/public.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 1407737d007..8799e3e6fc8 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -424,4 +424,18 @@ $(document).ready(function () { return App.fileList.generatePreviewUrl(urlSpec); }; } + + $('#share-menutoggle').click(function() { + $('#share-menu').show(); + }); +}); + + +$(document).mouseup(function(e) { + 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) { + container.hide(); + } }); -- cgit v1.2.3