From d456255b94bb1287a0ce5e21162574ec2393146c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 15 Aug 2006 21:11:52 +0000 Subject: [PATCH] Allow multiple ids in notifier add/item events on interface side (I didn't actually test this...) --- .../content/scholar/itemTreeView.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index 2264c2e375..2e45370b4b 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -154,16 +154,18 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids) } else if(action == 'add') { - var item = Scholar.Items.get(ids); - - if((this._itemGroup.isLibrary() || item.inCollection(this._itemGroup.ref.getID())) //if the item belongs in this collection - && this._itemRowMap[ids] == null //if we haven't already added it to our hash map - && (item.isRegularItem() || !item.getSource())) //if it's stand-alone - { - this._showItem(new Scholar.ItemTreeView.TreeRow(item,0,false),this.rowCount); - this._treebox.rowCountChanged(this.rowCount-1,1); - - madeChanges = true; + var items = Scholar.Items.get(ids); + + for (var i in items){ + if((this._itemGroup.isLibrary() || items[i].inCollection(this._itemGroup.ref.getID())) // if the item belongs in this collection + && this._itemRowMap[items[i].getID()] == null // if we haven't already added it to our hash map + && (items[i].isRegularItem() || !items[i].getSource())) // if it's stand-alone + { + this._showItem(new Scholar.ItemTreeView.TreeRow(items[i],0,false),this.rowCount); + this._treebox.rowCountChanged(this.rowCount-1,1); + + madeChanges = true; + } } }