www

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

commit fdbc11f2b3744a14ebd944f4b17242798bbdee97
parent 16845352b3f5a4eb74b24822aa96e47056d1e8bc
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 27 May 2011 20:19:25 +0000

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


Diffstat:
Mchrome/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 @@ -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) {