fix hasBibliography call for dependent styles

This commit is contained in:
Simon Kornblith 2011-01-31 20:16:06 +00:00
parent f1d0a3c1af
commit 25fbec095f

View File

@ -447,7 +447,22 @@ Zotero.Style.prototype.__defineGetter__("hasBibliography",
* @type String
*/
function() {
if(!this._hasBibliography) this.getXML();
if(this.source) {
// use hasBibliography from source style
var parentStyle = Zotero.Styles.get(this.source);
if(!parentStyle) {
throw(new Error('Style references '+this.source+', but this style is not installed',
Zotero.Styles.ios.newFileURI(this.file).spec, null));
}
return parentStyle.hasBibliography;
}
if(!this._hasBibliography) {
// if we don't know whether this style has a bibliography, it's because it's an ens style
// and we have to parse it to know
this.getXML();
}
return this._hasBibliography;
});