From e430074d2789a79d48d36cf57512d10d1e9d5d47 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 1ae1ad8..db8f4b2 100644 --- a/js/previewplugin.js +++ b/js/previewplugin.js @@ -92,6 +92,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