Wait to load all citations out of document before showing QuickFormat dialog if storeReferences is disabled. Otherwise people with missing references apparently get confused.

This commit is contained in:
Simon Kornblith 2012-02-06 19:28:49 -05:00
parent 3d58ef557d
commit 1c28a23aa6

View File

@ -1637,15 +1637,27 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field, callback)
var io = new Zotero.Integration.CitationEditInterface(citation, field, this, session, newField, callback);
if(Zotero.Prefs.get("integration.useClassicAddCitationDialog")) {
Zotero.Integration.displayDialog(this._doc,
'chrome://zotero/content/integration/addCitationDialog.xul', 'alwaysRaised,resizable',
io, true);
var doc = this._doc;
function openAddCitationDialog() {
if(Zotero.Prefs.get("integration.useClassicAddCitationDialog")) {
Zotero.Integration.displayDialog(doc,
'chrome://zotero/content/integration/addCitationDialog.xul', 'alwaysRaised,resizable',
io, true);
} else {
var mode = (!Zotero.isMac && Zotero.Prefs.get('integration.keepAddCitationDialogRaised')
? 'popup' : 'alwaysRaised')
Zotero.Integration.displayDialog(doc,
'chrome://zotero/content/integration/quickFormat.xul', mode, io, true);
}
}
if(session.data.prefs.storeReferences) {
// If references are stored in document, don't delay opening dialog to see if there are
// missing references
openAddCitationDialog();
} else {
var mode = (!Zotero.isMac && Zotero.Prefs.get('integration.keepAddCitationDialogRaised')
? 'popup' : 'alwaysRaised')
Zotero.Integration.displayDialog(this._doc,
'chrome://zotero/content/integration/quickFormat.xul', mode, io, true);
// Otherwise, read items out of the document before doing anything
io._runWhenSessionUpdated(openAddCitationDialog);
}
}