diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index 076b5cac9..1a4994f81 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -223,7 +223,7 @@ Scholar.Item.prototype.getCreators = function(){ /* * Set or update the creator at the specified position */ -Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, creatorTypeID){ +Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, creatorTypeID, isInstitution){ if (this.getID() && !this._creatorsLoaded){ this._loadCreators(); } @@ -236,11 +236,14 @@ Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, cr lastName = ''; } + isInstitution = !!isInstitution; + // If creator at this position hasn't changed, cancel if (this._creators.has(orderIndex) && this._creators.get(orderIndex)['firstName']==firstName && this._creators.get(orderIndex)['lastName']==lastName && - this._creators.get(orderIndex)['creatorTypeID']==creatorTypeID){ + this._creators.get(orderIndex)['creatorTypeID']==creatorTypeID && + this._creators.get(orderIndex)['isInstitution']==isInstitution){ return false; } @@ -252,6 +255,7 @@ Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, cr creator['firstName'] = firstName; creator['lastName'] = lastName; creator['creatorTypeID'] = creatorTypeID; + creator['isInstitution'] = isInstitution; this._creators.set(orderIndex, creator); this._changedCreators.set(orderIndex); @@ -283,7 +287,7 @@ Scholar.Item.prototype.removeCreator = function(orderIndex){ } -Scholar.Item.prototype.creatorExists = function(firstName, lastName, creatorTypeID, skipIndex){ +Scholar.Item.prototype.creatorExists = function(firstName, lastName, creatorTypeID, isInstitution, skipIndex){ for (var j=0, len=this.numCreators(); j