Fix for bug #849, allows locator to be tested in an <if variable="locator"> statement.

This commit is contained in:
Julian Onions 2007-11-30 09:43:42 +00:00
parent 79b972d362
commit 81640bcc2f

View File

@ -1197,7 +1197,11 @@ Zotero.CSL.prototype._processElements = function(item, element, formattedString,
var variables = newChild["@"+attribute].toString().split(" ");
for(var j=0; !done && j<variables.length; j++) {
if(attribute == "variable") {
if(Zotero.CSL._dateVariables[variables[j]]) {
if(variables[j] == "locator") {
// special case for locator
var exists = citationItem && citationItem.locator && citationItem.locator.length > 0
}
else if(Zotero.CSL._dateVariables[variables[j]]) {
// getDate not false/undefined
var exists = !!item.getDate(variables[j]);
} else if(Zotero.CSL._namesVariables[variables[j]]) {