www

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

commit b526a7f801329565e95e4c00136c42f03b409373
parent a86d6cd1ef7690a9fcf8e8b1471b2b253099eabc
Author: Simon Kornblith <simon@simonster.com>
Date:   Fri, 27 Jan 2012 04:42:25 -0500

Don't show an error when trying to insert a bibliography after the set document preferences window has been shown but the style has not been changed

Diffstat:
Mchrome/content/zotero/xpcom/integration.js | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js @@ -1613,9 +1613,9 @@ Zotero.Integration.Session.prototype.resetRequest = function(doc) { * @param data {Zotero.Integration.DocumentData} */ Zotero.Integration.Session.prototype.setData = function(data) { - var oldStyleID = (this.data && this.data.style.styleID ? this.data.style.styleID : false); + var oldStyle = (this.data && this.data.style ? this.data.style : false); this.data = data; - if(data.style.styleID && oldStyleID != data.style.styleID) { + if(!oldStyle || (data.style.styleID && oldStyle.styleID != data.style.styleID)) { this.styleID = data.style.styleID; try { var getStyle = Zotero.Styles.get(data.style.styleID); @@ -1631,6 +1631,8 @@ Zotero.Integration.Session.prototype.setData = function(data) { } return true; + } else { + data.style = oldStyle; } return false; }