From bbeb3402b6bc778de393b6da1b5fdc214f825b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 5 Apr 2018 12:21:39 +0200 Subject: [PATCH] Move styling and menu handling to publicpage.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_sharing/css/public.scss | 14 -------------- apps/files_sharing/js/public.js | 18 +----------------- apps/files_sharing/templates/public.php | 8 +------- core/css/public.scss | 16 +++++++++++++++- core/js/public/publicpage.js | 15 +++++++++++++-- core/templates/layout.public.php | 4 ++-- .../bootstrap/FilesSharingAppContext.php | 2 +- 7 files changed, 33 insertions(+), 44 deletions(-) diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss index cc3788884e..277814207b 100644 --- a/apps/files_sharing/css/public.scss +++ b/apps/files_sharing/css/public.scss @@ -1,13 +1,3 @@ -#content { - height: initial; - min-height: calc(100vh - 160px); -} - -/* force layout to make sure the content element's height matches its contents' height */ -.ie #content { - display: inline-block; -} - #preview { background: #fff; text-align: center; @@ -105,10 +95,6 @@ thead { border-color: rgba(0,0,0,0.3) !important; } -#share-menu input[type='text'] { - width: 200px; -} - #public-upload .avatardiv { margin: 0 auto; } diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 4b3ede2438..1be51d4b68 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -423,20 +423,4 @@ $(document).ready(function () { }; } - $('#share-menutoggle').click(function() { - $('#share-menu').toggleClass('open'); - }); -}); - - -$(document).mouseup(function(e) { - var toggle = $('#share-menutoggle'); - var container = $('#share-menu'); - - // 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'); - } -}); +}); \ No newline at end of file diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index e8eb28f25c..476f085154 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -30,7 +30,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); -
+
@@ -84,9 +84,3 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); data-url="getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" />
- -
-

- getLongFooter()); ?> -

-
diff --git a/core/css/public.scss b/core/css/public.scss index 6a175de643..412016bc62 100644 --- a/core/css/public.scss +++ b/core/css/public.scss @@ -1,7 +1,7 @@ #body-public { .header-right { - span:not(.popovermenu) a { + #header-primary-action a { color: $color-primary-text; } @@ -16,7 +16,21 @@ #header-secondary-action { margin-right: 13px; + + input[type='text'] { + width: 200px; + } } } + + #content { + height: initial; + min-height: calc(100vh - 160px); + } + + /* force layout to make sure the content element's height matches its contents' height */ + .ie #content { + display: inline-block; + } } diff --git a/core/js/public/publicpage.js b/core/js/public/publicpage.js index 31b862ba12..1b37005540 100644 --- a/core/js/public/publicpage.js +++ b/core/js/public/publicpage.js @@ -22,8 +22,19 @@ $(document).ready(function () { - console.log('public'); - $('#body-public .header-right .menutoggle').click(function() { + $('#body-public').find('.header-right .menutoggle').click(function() { $(this).next('.popovermenu').toggleClass('open'); }); }); + +$(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'); + } +}); diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php index d3c12f8fd9..61b6614450 100644 --- a/core/templates/layout.public.php +++ b/core/templates/layout.public.php @@ -50,13 +50,13 @@
- + getLabel()) ?> getActionCount()>1) { ?>
-