mirror of
https://github.com/zotero/zotero.git
synced 2026-09-22 00:32:47 +00:00
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
This commit is contained in:
parent
16845352b3
commit
fdbc11f2b3
1 changed files with 2 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue