From c2fea7e4daddc182d661d931135d79531f49b479 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 25 Jan 2010 08:50:47 +0000 Subject: [PATCH] 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.) --- chrome/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 index b4a677114..f4e514fa6 100644 --- 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 }