Commit d5ec8c3e authored by Jérome Perrin's avatar Jérome Perrin

dms: fix hidden buttons on PDF preview

Instead of disabling in javascript, which cause the button to be visible
for a few milliseconds, disable directly in the HTML file.

Do not hide "document properties", because it can be useful and it does
not hurt and "edit images" because we don't hide the buttons to edit
annotations either, so this is consistent.
parent 5ba514bc
Pipeline #31938 failed with stage
in 0 seconds
......@@ -147,13 +147,6 @@
PDFViewerApplicationOptions.set("workerSrc", "./pdf_js/build/pdf.worker.js");
return PDFViewerApplication.initialize(config).then(function() {
// hide some buttons that do not make sense for us
gadget.props.element.querySelector('#viewBookmark').hidden = true;
gadget.props.element.querySelector('#documentProperties').hidden = true;
gadget.props.element.querySelector('#download').hidden = true;
gadget.props.element.querySelector('#openFile').hidden = true;
gadget.props.element.querySelector('#editorStamp').hidden = true;
if (options.password) {
PDFViewerApplication.passwordPrompt._original_open = PDFViewerApplication.passwordPrompt.open;
var retries = 0;
......
......@@ -160,7 +160,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
<div id="secondaryToolbarButtonContainer">
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" tabindex="51" data-l10n-id="open_file">
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView hidden" title="Open File" tabindex="51" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
......@@ -168,7 +168,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="print_label">Print</span>
</button>
<button id="secondaryDownload" class="secondaryToolbarButton visibleMediumView" title="Save" tabindex="53" data-l10n-id="save">
<button id="secondaryDownload" class="secondaryToolbarButton visibleMediumView hidden" title="Save" tabindex="53" data-l10n-id="save">
<span data-l10n-id="save_label">Save</span>
</button>
......@@ -178,7 +178,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
<a href="#" id="viewBookmark" class="secondaryToolbarButton" title="Current Page (View URL from Current Page)" tabindex="55" data-l10n-id="bookmark1">
<a href="#" id="viewBookmark" class="secondaryToolbarButton hidden" title="Current Page (View URL from Current Page)" tabindex="55" data-l10n-id="bookmark1">
<span data-l10n-id="bookmark1_label">Current Page</span>
</a>
......@@ -274,7 +274,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span id="numPages" class="toolbarLabel"></span>
</div>
<div id="toolbarViewerRight">
<button id="openFile" class="toolbarButton hiddenLargeView" title="Open File" tabindex="31" data-l10n-id="open_file">
<button id="openFile" class="toolbarButton hiddenLargeView hidden" title="Open File" tabindex="31" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
......@@ -282,7 +282,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="print_label">Print</span>
</button>
<button id="download" class="toolbarButton hiddenMediumView" title="Save" tabindex="33" data-l10n-id="save">
<button id="download" class="toolbarButton hiddenMediumView hidden" title="Save" tabindex="33" data-l10n-id="save">
<span data-l10n-id="save_label">Save</span>
</button>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment