Skip to content

Commit

Permalink
Update citeproc instances in Integration on Styles.reinit
Browse files Browse the repository at this point in the history
  • Loading branch information
adomasven committed May 3, 2017
1 parent 37fa0c2 commit 8f19d1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chrome/content/zotero/xpcom/integration.js
Expand Up @@ -187,6 +187,13 @@ Zotero.Integration = new function() {
}
}

this.resetSessionStyles = Zotero.Promise.coroutine(function* (){
for (let sessionID in Zotero.Integration.sessions) {
let session = Zotero.Integration.sessions[sessionID];
yield session.setData(session.data, true);
}
});

/**
* Checks to see that plugin versions are up to date.
* @return {Promise} Promise that is resolved with true if versions are up to date
Expand Down
4 changes: 4 additions & 0 deletions chrome/content/zotero/xpcom/style.js
Expand Up @@ -130,6 +130,10 @@ Zotero.Styles = new function() {

_initializationDeferred.resolve();
_initialized = true;

// Styles are fully loaded, but we still need to trigger citeproc reloads in Integration
// so that style updates are reflected in open documents
Zotero.Integration.resetSessionStyles();
});

this.reinit = function (options = {}) {
Expand Down

0 comments on commit 8f19d1f

Please sign in to comment.