Prevent the Zoom dropdown from intermittently displaying an incorrect custom scale in Firefox (PR 8394 follow-up)
After PR 8394, at least in Firefox, the Zoom dropdown now frequently displays an old custom scale instead of the correct one. To see this behaviour, the following STR works for me: 1. Open https://mozilla.github.io/pdf.js/web/viewer.html. 2. Zoom in, by clicking on the corresponding button in the toolbar. 3. Run `PDFViewerApplication.pdfViewer.currentScaleValue` in the console. 4. Compare what's displayed in the Zoom dropdown with what's printed in the console. (If no difference can be observed, try repeating steps 2 through 4 a couple of times.) I really don't understand why this happens, but it seems that waiting until a custom scale has been set *before* selecting it fixes things in Firefox (and works fine in e.g. Chrome as well). Note that this patch thus makes this particular piece of the code consistent with the state prior to PR 8394.
This commit is contained in:
parent
f34d692758
commit
2971f522d4
@ -194,11 +194,10 @@ var Toolbar = (function ToolbarClosure() {
|
||||
if (!predefinedValueFound) {
|
||||
var customScale = Math.round(scale * 10000) / 100;
|
||||
this.l10n.get('page_scale_percent', { scale: customScale, },
|
||||
'{{scale}}%').
|
||||
then((msg) => {
|
||||
'{{scale}}%').then((msg) => {
|
||||
items.customScaleOption.textContent = msg;
|
||||
items.customScaleOption.selected = true;
|
||||
});
|
||||
items.customScaleOption.selected = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user