Browse Source

Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)

Jonas Jenwald 11 years ago
parent
commit
5abe1cae6a
  1. 7
      web/viewer.js

7
web/viewer.js

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

Loading…
Cancel
Save