Integration: Don't activate document after clicking Manage Styles in Doc Prefs
Closes #4290
This commit is contained in:
parent
d5bb667fb3
commit
87f7a6a7bd
2 changed files with 6 additions and 1 deletions
|
@ -324,6 +324,7 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
|
|
||||||
|
|
||||||
this.manageStyles = function () {
|
this.manageStyles = function () {
|
||||||
|
_io.dontActivateDocument = true;
|
||||||
document.querySelector('dialog').cancelDialog();
|
document.querySelector('dialog').cancelDialog();
|
||||||
var win = Zotero.Utilities.Internal.openPreferences('zotero-prefpane-cite', {
|
var win = Zotero.Utilities.Internal.openPreferences('zotero-prefpane-cite', {
|
||||||
scrollTo: '#styles'
|
scrollTo: '#styles'
|
||||||
|
|
|
@ -329,7 +329,9 @@ Zotero.Integration = new function() {
|
||||||
if (document) {
|
if (document) {
|
||||||
try {
|
try {
|
||||||
await document.cleanup();
|
await document.cleanup();
|
||||||
await document.activate();
|
if (!Zotero.Integration.currentSession._dontActivateDocument) {
|
||||||
|
await document.activate();
|
||||||
|
}
|
||||||
|
|
||||||
// Call complete function if one exists
|
// Call complete function if one exists
|
||||||
if (document.complete) {
|
if (document.complete) {
|
||||||
|
@ -956,6 +958,7 @@ Zotero.Integration.Session = function(doc, app) {
|
||||||
this.primaryFieldType = app.primaryFieldType;
|
this.primaryFieldType = app.primaryFieldType;
|
||||||
this.secondaryFieldType = app.secondaryFieldType;
|
this.secondaryFieldType = app.secondaryFieldType;
|
||||||
this.outputFormat = app.outputFormat || 'rtf';
|
this.outputFormat = app.outputFormat || 'rtf';
|
||||||
|
this._dontActivateDocument = false;
|
||||||
this._sessionUpToDate = false;
|
this._sessionUpToDate = false;
|
||||||
this._app = app;
|
this._app = app;
|
||||||
|
|
||||||
|
@ -1889,6 +1892,7 @@ Zotero.Integration.Session.prototype.setDocPrefs = async function (showImportExp
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!io.style || !io.fieldType) {
|
if (!io.style || !io.fieldType) {
|
||||||
|
this._dontActivateDocument = io.dontActivateDocument;
|
||||||
throw new Zotero.Exception.UserCancelled("document preferences window");
|
throw new Zotero.Exception.UserCancelled("document preferences window");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue