Merge pull request #8510 from Snuffleupagus/zoom-dropdown-glitches
Prevent the Zoom dropdown from intermittently displaying an incorrect custom scale in Firefox (PR 8394 follow-up)
This commit is contained in:
commit
08c6437196
@ -180,26 +180,25 @@ var Toolbar = (function ToolbarClosure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let selectScaleOption = (value, scale) => {
|
let selectScaleOption = (value, scale) => {
|
||||||
var options = items.scaleSelect.options;
|
let customScale = Math.round(scale * 10000) / 100;
|
||||||
var predefinedValueFound = false;
|
this.l10n.get('page_scale_percent', { scale: customScale, },
|
||||||
for (var i = 0, ii = options.length; i < ii; i++) {
|
'{{scale}}%').then((msg) => {
|
||||||
var option = options[i];
|
let options = items.scaleSelect.options;
|
||||||
if (option.value !== value) {
|
let predefinedValueFound = false;
|
||||||
option.selected = false;
|
for (let i = 0, ii = options.length; i < ii; i++) {
|
||||||
continue;
|
let option = options[i];
|
||||||
|
if (option.value !== value) {
|
||||||
|
option.selected = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
option.selected = true;
|
||||||
|
predefinedValueFound = true;
|
||||||
}
|
}
|
||||||
option.selected = true;
|
if (!predefinedValueFound) {
|
||||||
predefinedValueFound = true;
|
|
||||||
}
|
|
||||||
if (!predefinedValueFound) {
|
|
||||||
var customScale = Math.round(scale * 10000) / 100;
|
|
||||||
this.l10n.get('page_scale_percent', { scale: customScale, },
|
|
||||||
'{{scale}}%').
|
|
||||||
then((msg) => {
|
|
||||||
items.customScaleOption.textContent = msg;
|
items.customScaleOption.textContent = msg;
|
||||||
});
|
items.customScaleOption.selected = true;
|
||||||
items.customScaleOption.selected = true;
|
}
|
||||||
}
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var pageNumber = this.pageNumber;
|
var pageNumber = this.pageNumber;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user