- fix Bookmarks preference not sticking in Document Preferences
- activate document before and after showing Prefs window
This commit is contained in:
parent
ffeaaa2216
commit
39ab82f9db
|
@ -106,8 +106,7 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
styleChanged(selectIndex);
|
styleChanged(selectIndex);
|
||||||
}
|
}
|
||||||
if(document.getElementById("formatUsing")) {
|
if(document.getElementById("formatUsing")) {
|
||||||
if(_io.fieldType == "Bookmarks") document.getElementById("formatUsing").selectedIndex = 1;
|
if(_io.fieldType == "Bookmark") document.getElementById("formatUsing").selectedIndex = 1;
|
||||||
Zotero.safeDebug(_io)
|
|
||||||
var formatOption = (_io.primaryFieldType == "ReferenceMark" ? "referenceMarks" : "fields");
|
var formatOption = (_io.primaryFieldType == "ReferenceMark" ? "referenceMarks" : "fields");
|
||||||
document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label");
|
document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label");
|
||||||
document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption");
|
document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption");
|
||||||
|
|
|
@ -246,7 +246,9 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet
|
||||||
this._session = this._createNewSession(new Zotero.Integration.DocumentData());
|
this._session = this._createNewSession(new Zotero.Integration.DocumentData());
|
||||||
if(dontRunSetDocPrefs) return false;
|
if(dontRunSetDocPrefs) return false;
|
||||||
|
|
||||||
|
Zotero.Integration.activate();
|
||||||
var ret = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
var ret = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
||||||
|
this._doc.activate();
|
||||||
if(!ret) return false;
|
if(!ret) return false;
|
||||||
// save doc prefs in doc
|
// save doc prefs in doc
|
||||||
this._doc.setDocumentData(this._session.data.serializeXML());
|
this._doc.setDocumentData(this._session.data.serializeXML());
|
||||||
|
@ -272,7 +274,9 @@ Zotero.Integration.Document.prototype._getSession = function(require, dontRunSet
|
||||||
|
|
||||||
// make sure style is defined
|
// make sure style is defined
|
||||||
if(!this._session.style) {
|
if(!this._session.style) {
|
||||||
|
Zotero.Integration.activate();
|
||||||
this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
||||||
|
this._doc.activate();
|
||||||
}
|
}
|
||||||
this._doc.setDocumentData(this._session.data.serializeXML());
|
this._doc.setDocumentData(this._session.data.serializeXML());
|
||||||
}
|
}
|
||||||
|
@ -625,7 +629,9 @@ Zotero.Integration.Document.prototype.removeCodes = function() {
|
||||||
*/
|
*/
|
||||||
Zotero.Integration.Document.prototype.setDocPrefs = function() {
|
Zotero.Integration.Document.prototype.setDocPrefs = function() {
|
||||||
if(this._getSession(false, true)) this._getFields();
|
if(this._getSession(false, true)) this._getFields();
|
||||||
|
Zotero.Integration.activate();
|
||||||
var oldData = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
var oldData = this._session.setDocPrefs(this._app.primaryFieldType, this._app.secondaryFieldType);
|
||||||
|
this._doc.activate();
|
||||||
if(oldData) {
|
if(oldData) {
|
||||||
this._doc.setDocumentData(this._session.data.serializeXML());
|
this._doc.setDocumentData(this._session.data.serializeXML());
|
||||||
if(this._fields && this._fields.length) {
|
if(this._fields && this._fields.length) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user