Merge pull request #2612 from Snuffleupagus/zoom-select-adjustable-width

Resize the zoom box width to fit the content
This commit is contained in:
Yury Delendik 2013-01-31 20:04:50 -08:00
commit 74bfc3ddf7
2 changed files with 10 additions and 1 deletions

View File

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

View File

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