www

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

commit c2fea7e4daddc182d661d931135d79531f49b479
parent da0c883f451dc882720204e06082dd1468f315e0
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 25 Jan 2010 08:50:47 +0000

Fix "Item already exists outside of collection" error and UI weirdness dragging child items between items

(Don't bother removing an existing row for the item when creating the new one, since the old one will be removed in the fullness of time.)


Diffstat:
Mchrome/content/zotero/xpcom/itemTreeView.js | 16+---------------
1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -387,6 +387,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData) var id = item.id; var row = this._itemRowMap[id]; + // Item already exists in this view if( row != null) { @@ -762,21 +763,6 @@ Zotero.ItemTreeView.prototype.toggleOpenState = function(row, skipItemMapRefresh for(var i = 0; i < newRows.length; i++) { - // If item already exists elsewhere in the tree, we have to - // remove it -- this can happen when moving an item into a - // collection if the collection gets the modify event before - // the item - var existingRow = this._itemRowMap[newRows[i].id]; - if (existingRow != null) { - /* - this._hideItem(existingRow); - this._treebox.rowCountChanged(existingRow + 1, -1); - if (existingRow < row) { - row--; - } - */ - throw ("Item already exists outside of collection in Zotero.ItemTreeView.toggleOpenRow()"); - } count++; this._showItem(new Zotero.ItemTreeView.TreeRow(newRows[i], thisLevel + 1, false), row + i + 1); // item ref, before row }