commit 1c28a23aa64377cb3347d5a2bab19488d72795ca
parent 3d58ef557dea710fa81e9d096b407d3d27d25b55
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 6 Feb 2012 19:28:49 -0500
Wait to load all citations out of document before showing QuickFormat dialog if storeReferences is disabled. Otherwise people with missing references apparently get confused.
Diffstat:
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
@@ -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);
}
}