Fix Scaffold load error when fontSize pref is set

This commit is contained in:
Abe Jellinek 2022-05-10 09:09:25 -07:00
parent 4d35cdf095
commit a11c5987ad

View file

@ -99,15 +99,6 @@ var Scaffold = new function () {
} }
}); });
// Set font size from general pref
Zotero.setFontSize(document.getElementById('scaffold-pane'));
// Set font size of code editor
var size = Zotero.Prefs.get("scaffold.fontSize");
if (size) {
this.setFontSize(size);
}
this.generateTranslatorID(); this.generateTranslatorID();
// Add List fields help menu entries for all other item types // Add List fields help menu entries for all other item types
@ -146,6 +137,15 @@ var Scaffold = new function () {
this.initCodeEditor(); this.initCodeEditor();
this.initTestsEditor(); this.initTestsEditor();
// Set font size from general pref
Zotero.setFontSize(document.getElementById('scaffold-pane'));
// Set font size of code editor
var size = Zotero.Prefs.get("scaffold.fontSize");
if (size) {
this.setFontSize(size);
}
// Listen for Scaffold coming to the foreground and reload translators // Listen for Scaffold coming to the foreground and reload translators
window.addEventListener('activate', () => this.reloadTranslators()); window.addEventListener('activate', () => this.reloadTranslators());