www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit d456255b94bb1287a0ce5e21162574ec2393146c
parent 844fcc0ee957afafc18ea7c37d89754dac762bda
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 15 Aug 2006 21:11:52 +0000

Allow multiple ids in notifier add/item events on interface side

(I didn't actually test this...)


Diffstat:
Mchrome/chromeFiles/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 @@ -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; + } } }