From fdbc11f2b3744a14ebd944f4b17242798bbdee97 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 27 May 2011 20:19:25 +0000 Subject: [PATCH] Fixes #1798, Apparent duplication of standalone attachment after drag Trigger change notification for moved item before new parent item so that the tree view can detect that the moved item is in the wrong place, remove it, and then refresh the new parent item's children --- chrome/content/zotero/xpcom/data/item.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 8923d2f345..499777905b 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1448,6 +1448,7 @@ Zotero.Item.prototype.save = function() { Zotero.DB.query(sql, bindParams); } + Zotero.Notifier.trigger('add', 'item', itemID); // Parent item if (this._sourceItem) { @@ -1831,6 +1832,7 @@ Zotero.Item.prototype.save = function() { Zotero.DB.query(sql, bindParams); } + Zotero.Notifier.trigger('modify', 'item', this.id, { old: this._previousData }); // Parent if (this._changedSource) { @@ -2048,13 +2050,6 @@ Zotero.Item.prototype.save = function() { Zotero.Items.reload(this.id); - if (isNew) { - Zotero.Notifier.trigger('add', 'item', this.id); - } - else { - Zotero.Notifier.trigger('modify', 'item', this.id, { old: this._previousData }); - } - this._previousData = null; if (isNew) {