Fix first item drag of session
https://forums.zotero.org/discussion/35206/
This commit is contained in:
parent
015b37a85e
commit
5ddfdec584
2 changed files with 14 additions and 6 deletions
|
@ -45,6 +45,18 @@ Zotero.Styles = new function() {
|
|||
"csl":"http://purl.org/net/xbiblio/csl"
|
||||
};
|
||||
|
||||
// TEMP
|
||||
// Until we get asynchronous style loading, load renamed styles at startup, since the
|
||||
// synchronous call we were using breaks the first drag of the session (on OS X, at least)
|
||||
this.preinit = function () {
|
||||
_renamedStyles = {};
|
||||
Zotero.HTTP.promise("GET", "resource://zotero/schema/renamed-styles.json")
|
||||
.then(function (xmlhttp) {
|
||||
// Map some obsolete styles to current ones
|
||||
_renamedStyles = JSON.parse(xmlhttp.responseText);
|
||||
})
|
||||
.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes styles cache, loading metadata for styles into memory
|
||||
|
@ -123,12 +135,7 @@ Zotero.Styles = new function() {
|
|||
this.get = function(id, skipMappings) {
|
||||
if(!_initialized) this.init();
|
||||
|
||||
// Map some obsolete styles to current ones
|
||||
if(!_renamedStyles) {
|
||||
_renamedStyles = JSON.parse(Zotero.File.getContentsFromURL(
|
||||
"resource://zotero/schema/renamed-styles.json"
|
||||
));
|
||||
}
|
||||
// TODO: With asynchronous style loading, move renamedStyles call back here
|
||||
|
||||
if(!skipMappings) {
|
||||
var prefix = "http://www.zotero.org/styles/";
|
||||
|
|
|
@ -725,6 +725,7 @@ Components.utils.import("resource://gre/modules/Services.jsm");
|
|||
}
|
||||
|
||||
// Initialize various services
|
||||
Zotero.Styles.preinit();
|
||||
Zotero.Integration.init();
|
||||
|
||||
if(Zotero.Prefs.get("httpServer.enabled")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue