mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
Bug 1674599 - Wait for l10n to finish before resizing window. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D95692
This commit is contained in:
1 parent
b5913135dc
commit
1470870608
2 files changed
+22
-13
No files matched your search
@@ -58,7 +58,7 @@ let dialog = {
|
||||
/**
|
||||
* This function initializes the content of the dialog.
|
||||
*/
|
||||
initialize: function initialize() {
|
||||
initialize() {
|
||||
let args = window.arguments[0].wrappedJSObject || window.arguments[0];
|
||||
let { handler, outArgs, usePrivateBrowsing, enableButtonDelay } = args;
|
||||
|
||||
@@ -73,19 +73,9 @@ let dialog = {
|
||||
this._itemChoose = document.getElementById("item-choose");
|
||||
this._rememberCheck = document.getElementById("remember");
|
||||
|
||||
let rememberLabel = document.getElementById("remember-label");
|
||||
document.l10n.setAttributes(rememberLabel, "chooser-dialog-remember", {
|
||||
scheme: this._handlerInfo.type,
|
||||
});
|
||||
|
||||
// Register event listener for the checkbox hint.
|
||||
this._rememberCheck.addEventListener("change", () => this.onCheck());
|
||||
|
||||
let description = document.getElementById("description");
|
||||
document.l10n.setAttributes(description, "chooser-dialog-description", {
|
||||
scheme: this._handlerInfo.type,
|
||||
});
|
||||
|
||||
document.addEventListener("dialogaccept", () => {
|
||||
this.onAccept();
|
||||
});
|
||||
@@ -93,7 +83,7 @@ let dialog = {
|
||||
// UI is ready, lets populate our list
|
||||
this.populateList();
|
||||
|
||||
document.mozSubdialogReady = document.l10n.ready.then(() => {
|
||||
document.mozSubdialogReady = this.initL10n().then(() => {
|
||||
window.sizeToContent();
|
||||
});
|
||||
|
||||
@@ -112,6 +102,25 @@ let dialog = {
|
||||
}
|
||||
},
|
||||
|
||||
async initL10n() {
|
||||
document.l10n.pauseObserving();
|
||||
|
||||
let rememberLabel = document.getElementById("remember-label");
|
||||
document.l10n.setAttributes(rememberLabel, "chooser-dialog-remember", {
|
||||
scheme: this._handlerInfo.type,
|
||||
});
|
||||
|
||||
let description = document.getElementById("description");
|
||||
document.l10n.setAttributes(description, "chooser-dialog-description", {
|
||||
scheme: this._handlerInfo.type,
|
||||
});
|
||||
|
||||
document.l10n.resumeObserving();
|
||||
|
||||
await document.l10n.translateElements([rememberLabel, description]);
|
||||
return document.l10n.ready;
|
||||
},
|
||||
|
||||
/**
|
||||
* Populates the list that a user can choose from.
|
||||
*/
|
||||
|
||||
@@ -157,9 +157,9 @@ let dialog = {
|
||||
}
|
||||
});
|
||||
|
||||
await document.l10n.translateElements(pendingElements);
|
||||
document.l10n.resumeObserving();
|
||||
|
||||
await document.l10n.translateElements(pendingElements);
|
||||
return document.l10n.ready;
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user