[Pkg-javascript-commits] [pdf.js] 09/204: Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 5abe1cae6a6b647086733085e6a5fecf4c70b795
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Aug 21 13:02:19 2014 +0200

    Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)
---
 web/viewer.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/web/viewer.js b/web/viewer.js
index 4a4282e..b8fe3bc 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -2155,9 +2155,12 @@ window.addEventListener('localized', function localized(evt) {
 
   PDFView.animationStartedPromise.then(function() {
     // Adjust the width of the zoom box to fit the content.
-    // Note: This is only done if the zoom box is actually visible,
-    // since otherwise element.clientWidth will return 0.
+    // Note: If the window is narrow enough that the zoom box is not visible,
+    //       we temporarily show it to be able to adjust its width.
     var container = document.getElementById('scaleSelectContainer');
+    if (container.clientWidth === 0) {
+      container.setAttribute('style', 'display: inherit;');
+    }
     if (container.clientWidth > 0) {
       var select = document.getElementById('scaleSelect');
       select.setAttribute('style', 'min-width: inherit;');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list