commit d4532f0cdf2bee40cfcec774c1c5b3329179a17d parent c2dd531cec4e5db65d0b02570eb36c35160c27e1 Author: Dan Stillman <dstillman@zotero.org> Date: Thu, 23 Jun 2016 03:05:49 -0400 Merge pull request #1040 from rmzelle/inherit-class Correctly inherit "class" from parent style Diffstat:
| M | chrome/content/zotero/xpcom/style.js | | | 9 | ++++++++- |
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js @@ -714,7 +714,14 @@ Zotero.Style.prototype.__defineGetter__("class", * @type String */ function() { - if(!this._class) this.getXML(); + if(this.source) { + // use class from source style + var parentStyle = Zotero.Styles.get(this.source); + if(!parentStyle) { + throw new Error('Style references missing parent ' + this.source); + } + return parentStyle.class; + } return this._class; });