diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index 1d7d4e9c5..0ff60b8f4 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -45,7 +45,7 @@ var Zotero_File_Interface_Bibliography = new function() { * Initialize some variables and prepare event listeners for when chrome is done * loading */ - this.init = function () { + this.init = Zotero.Promise.coroutine(function* () { // Set font size from pref // Affects bibliography.xul and integrationDocPrefs.xul var bibContainer = document.getElementById("zotero-bibliography-container"); @@ -68,6 +68,8 @@ var Zotero_File_Interface_Bibliography = new function() { } // add styles to list + + yield Zotero.Styles.init(); var styles = Zotero.Styles.getVisible(); var index = 0; var nStyles = styles.length; @@ -171,7 +173,7 @@ var Zotero_File_Interface_Bibliography = new function() { // set style to false, in case this is cancelled _io.style = false; - }; + }); /* * Called when locale is changed diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index bdd97be0a..927385891 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -49,7 +49,6 @@ Zotero.Styles = new function() { this.reinit = Zotero.Promise.coroutine(function* () { Zotero.debug("Initializing styles"); var start = new Date; - _initialized = true; // Upgrade style locale prefs for 4.0.27 var bibliographyLocale = Zotero.Prefs.get("export.bibliographyLocale"); @@ -114,6 +113,7 @@ Zotero.Styles = new function() { _renamedStyles = xmlhttp.response; } }) + _initialized = true; }); this.init = Zotero.lazy(this.reinit);