From 9405ef925abca8dde28b374b9e7cb1f3f498b516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 27 Jun 2019 16:21:51 +0200 Subject: Fix download button shown in public share page with hidden downloads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The download buttons are now hidden using JavaScript when the PDF viewer is loaded in the public share page if the share has the "Hide download" option enabled; this needs to be done in JavaScript instead of in the template as in the template there is no access to that option. Signed-off-by: Daniel Calviño Sánchez --- js/previewplugin.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/previewplugin.js b/js/previewplugin.js index 7760de2..ad3b338 100644 --- a/js/previewplugin.js +++ b/js/previewplugin.js @@ -93,6 +93,11 @@ } else { iframe.find("#secondaryToolbarClose").addClass('hidden'); } + + var hideDownload = $('#hideDownload').val(); + if (hideDownload === 'true') { + iframe.find('.download').addClass('hidden'); + } }); if(!$('html').hasClass('ie8')) { -- cgit v1.2.3