Fix document preferences dialog failing when styles unloaded.
Closes #1084
This commit is contained in:
parent
64414e49be
commit
d5cf33a798
|
@ -45,7 +45,7 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
* Initialize some variables and prepare event listeners for when chrome is done
|
* Initialize some variables and prepare event listeners for when chrome is done
|
||||||
* loading
|
* loading
|
||||||
*/
|
*/
|
||||||
this.init = function () {
|
this.init = Zotero.Promise.coroutine(function* () {
|
||||||
// Set font size from pref
|
// Set font size from pref
|
||||||
// Affects bibliography.xul and integrationDocPrefs.xul
|
// Affects bibliography.xul and integrationDocPrefs.xul
|
||||||
var bibContainer = document.getElementById("zotero-bibliography-container");
|
var bibContainer = document.getElementById("zotero-bibliography-container");
|
||||||
|
@ -68,6 +68,8 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add styles to list
|
// add styles to list
|
||||||
|
|
||||||
|
yield Zotero.Styles.init();
|
||||||
var styles = Zotero.Styles.getVisible();
|
var styles = Zotero.Styles.getVisible();
|
||||||
var index = 0;
|
var index = 0;
|
||||||
var nStyles = styles.length;
|
var nStyles = styles.length;
|
||||||
|
@ -171,7 +173,7 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
|
|
||||||
// set style to false, in case this is cancelled
|
// set style to false, in case this is cancelled
|
||||||
_io.style = false;
|
_io.style = false;
|
||||||
};
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when locale is changed
|
* Called when locale is changed
|
||||||
|
|
|
@ -49,7 +49,6 @@ Zotero.Styles = new function() {
|
||||||
this.reinit = Zotero.Promise.coroutine(function* () {
|
this.reinit = Zotero.Promise.coroutine(function* () {
|
||||||
Zotero.debug("Initializing styles");
|
Zotero.debug("Initializing styles");
|
||||||
var start = new Date;
|
var start = new Date;
|
||||||
_initialized = true;
|
|
||||||
|
|
||||||
// Upgrade style locale prefs for 4.0.27
|
// Upgrade style locale prefs for 4.0.27
|
||||||
var bibliographyLocale = Zotero.Prefs.get("export.bibliographyLocale");
|
var bibliographyLocale = Zotero.Prefs.get("export.bibliographyLocale");
|
||||||
|
@ -114,6 +113,7 @@ Zotero.Styles = new function() {
|
||||||
_renamedStyles = xmlhttp.response;
|
_renamedStyles = xmlhttp.response;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
_initialized = true;
|
||||||
});
|
});
|
||||||
this.init = Zotero.lazy(this.reinit);
|
this.init = Zotero.lazy(this.reinit);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user