Merge pull request #1040 from rmzelle/inherit-class
Correctly inherit "class" from parent style
This commit is contained in:
commit
d4532f0cdf
1 changed files with 8 additions and 1 deletions
|
@ -714,7 +714,14 @@ Zotero.Style.prototype.__defineGetter__("class",
|
||||||
* @type String
|
* @type String
|
||||||
*/
|
*/
|
||||||
function() {
|
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;
|
return this._class;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue