From 3c67d892bfe38cb27fa5455fa3abb88b96081901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sun, 18 Feb 2018 22:22:58 +0100 Subject: [PATCH] Fix gallery button hidden in folders without create permission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the "Files" app the actions that require the create permission (those marked as "creatable") are hidden in folders that do not have that permission. However, as there is only one ".actions" element inside "#controls" and that ".actions" element also has the "creatable" CSS class appending the gallery button to it meant that the gallery button was hidden in folders without create permissions. Now the gallery button is appended to the "#controls" element instead, and thus it is no longer affected by the permissions of the folder. As the button is now appended to the "#controls" element its top margin was increased to align it with the rest of the buttons (as the ".actions" element uses a padding of 5px), and as the button appears in the top right corner of the contents its right margin was set to the same value as the top margin to "frame" the button. Signed-off-by: Daniel Calviño Sánchez --- css/gallerybutton.css | 5 +++++ js/gallerybutton.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/css/gallerybutton.css b/css/gallerybutton.css index c30f49293..cca368dbc 100644 --- a/css/gallerybutton.css +++ b/css/gallerybutton.css @@ -4,6 +4,11 @@ margin-left: auto; } +#controls .button.view-switcher:not(.gallery) { + margin-top: 5px; + margin-right: 5px; +} + #controls .button.view-switcher.gallery { margin-right: 4px; padding: 9px 11px; diff --git a/js/gallerybutton.js b/js/gallerybutton.js index 8bd01f97b..2fb0e6fda 100644 --- a/js/gallerybutton.js +++ b/js/gallerybutton.js @@ -81,7 +81,7 @@ $(document).ready(function () { window.location.href = GalleryButton.url; }); - $('#controls .actions').append(GalleryButton.button); + $('#controls').append(GalleryButton.button); } } );