www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8f19d1f82688d3194242dacb47bd3412ffc21b10
parent 37fa0c203fb74a6245f6d98702a0350e340f02bc
Author: Adomas VenĨkauskas <adomas.ven@gmail.com>
Date:   Wed,  3 May 2017 14:35:41 +0300

Update citeproc instances in Integration on Styles.reinit

Closes zotero/zotero-word-for-windows-integration#34

Diffstat:
Mchrome/content/zotero/xpcom/integration.js | 7+++++++
Mchrome/content/zotero/xpcom/style.js | 4++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -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 diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -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 = {}) {