aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2017-09-29 18:02:14 +0200
committerJan-Christoph Borchardt <hey@jancborchardt.net>2017-11-01 11:52:58 +0100
commit116cb58c3c47cbe88bed7f4d0dd7bb7cd703a714 (patch)
tree8ff52f0d912624618869ce9b773549ddf7daaa85
parentf2fadf677c995a56d435708184f3bd3e8c8b620a (diff)
downloadnextcloud-server-116cb58c3c47cbe88bed7f4d0dd7bb7cd703a714.tar.gz
nextcloud-server-116cb58c3c47cbe88bed7f4d0dd7bb7cd703a714.zip
Show and hide menu via Javascript, thanks @skjnldsv
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
-rw-r--r--apps/files_sharing/css/mobile.scss8
-rw-r--r--apps/files_sharing/js/public.js14
-rw-r--r--apps/files_sharing/templates/public.php4
3 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/css/mobile.scss b/apps/files_sharing/css/mobile.scss
index 00a7cd1baf2..56f57d53263 100644
--- a/apps/files_sharing/css/mobile.scss
+++ b/apps/files_sharing/css/mobile.scss
@@ -46,5 +46,13 @@ table td.filename .nametext {
text-overflow: ellipsis;
}
+// Hide Download label of 3-dot-menu on public share pages
+.share-menutoggle-text {
+ display: none;
+}
+#header .menutoggle {
+ padding-right: 14px;
+ background-position: center;
+}
}
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();
+ }
});
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 4903ff798dd..9508b9f68ba 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -49,8 +49,8 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<div class="header-right">
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
- <a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><?php p($l->t('Download')) ?></a>
- <div id="share-menu" class="popovermenu menu hidden" style="display: block;">
+ <a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><span class="share-menutoggle-text"><?php p($l->t('Download')) ?></span></a>
+ <div id="share-menu" class="popovermenu menu hidden">
<ul>
<li>
<a href="<?php p($_['downloadURL']); ?>" id="download">