Merge pull request #2816 from Snuffleupagus/zoom-select-adjust-followup

Resize the zoom box width to fit the content - fix embedding
This commit is contained in:
Yury Delendik 2013-02-28 08:25:44 -08:00
commit 7ca99df0d7
2 changed files with 11 additions and 8 deletions

View File

@ -667,6 +667,7 @@ html[dir='rtl'] .dropdownToolbarButton {
} }
.dropdownToolbarButton { .dropdownToolbarButton {
width: 120px;
max-width: 120px; max-width: 120px;
padding: 3px 2px 2px; padding: 3px 2px 2px;
overflow: hidden; overflow: hidden;

View File

@ -3162,14 +3162,16 @@ window.addEventListener('localized', function localized(evt) {
document.getElementsByTagName('html')[0].dir = mozL10n.getDirection(); document.getElementsByTagName('html')[0].dir = mozL10n.getDirection();
// Adjust the width of the zoom box to fit the content. // Adjust the width of the zoom box to fit the content.
var container = document.getElementById('scaleSelectContainer'); PDFView.animationStartedPromise.then(
var select = document.getElementById('scaleSelect'); function() {
var container = document.getElementById('scaleSelectContainer');
select.setAttribute('style', 'min-width: inherit;'); var select = document.getElementById('scaleSelect');
var width = select.clientWidth + 8; select.setAttribute('style', 'min-width: inherit;');
container.setAttribute('style', 'min-width: ' + width + 'px; ' + var width = select.clientWidth + 8;
'max-width: ' + width + 'px;'); select.setAttribute('style', 'min-width: ' + (width + 20) + 'px;');
select.setAttribute('style', 'min-width: ' + (width + 20) + 'px;'); container.setAttribute('style', 'min-width: ' + width + 'px; ' +
'max-width: ' + width + 'px;');
});
}, true); }, true);
window.addEventListener('scalechange', function scalechange(evt) { window.addEventListener('scalechange', function scalechange(evt) {