Correctly inherit "class" from parent style

This commit is contained in:
rmzelle 2016-06-18 20:28:28 -04:00
parent 2225f459b7
commit e49c09f4a1

View file

@ -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;
});