diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-06-27 17:21:51 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-07-15 22:57:02 +0300 |
commit | e430074d2789a79d48d36cf57512d10d1e9d5d47 (patch) | |
tree | 60a5fb90d514240954930818c9d835a2b8984373 | |
parent | 6acee25400b084c386d8e7dd3f0b438f01d4773e (diff) |
Fix download button shown in public share page with hidden downloads
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 <danxuliu@gmail.com>
-rw-r--r-- | js/previewplugin.js | 5 |
1 files changed, 5 insertions, 0 deletions
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')) { |