commit 39ab82f9dba08785af8104bb7580006382edec7d
parent ffeaaa22162c04c0ebb2f4afe7502314223fb182
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 24 Aug 2009 03:26:17 +0000
- fix Bookmarks preference not sticking in Document Preferences
- activate document before and after showing Prefs window
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js
@@ -106,8 +106,7 @@ var Zotero_File_Interface_Bibliography = new function() {
styleChanged(selectIndex);
}
if(document.getElementById("formatUsing")) {
- if(_io.fieldType == "Bookmarks") document.getElementById("formatUsing").selectedIndex = 1;
- Zotero.safeDebug(_io)
+ if(_io.fieldType == "Bookmark") document.getElementById("formatUsing").selectedIndex = 1;
var formatOption = (_io.primaryFieldType == "ReferenceMark" ? "referenceMarks" : "fields");
document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label");
document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption");
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
@@ -246,7 +246,9 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet
this._session = this._createNewSession(new Zotero.Integration.DocumentData());
if(dontRunSetDocPrefs) return false;
+ Zotero.Integration.activate();
var ret = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
+ this._doc.activate();
if(!ret) return false;
// save doc prefs in doc
this._doc.setDocumentData(this._session.data.serializeXML());
@@ -272,7 +274,9 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet
// make sure style is defined
if(!this._session.style) {
+ Zotero.Integration.activate();
this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
+ this._doc.activate();
}
this._doc.setDocumentData(this._session.data.serializeXML());
}
@@ -625,7 +629,9 @@ Zotero.Integration.Document.prototype.removeCodes = function() {
*/
Zotero.Integration.Document.prototype.setDocPrefs = function() {
if(this._getSession(false, true)) this._getFields();
+ Zotero.Integration.activate();
var oldData = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
+ this._doc.activate();
if(oldData) {
this._doc.setDocumentData(this._session.data.serializeXML());
if(this._fields && this._fields.length) {