www

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

commit 01f50b9e4b3ec5344eee0551c5e1a7d17d300b93
parent 1336842d74ff4e0b5c45bc9a52b8a8f5bb1f6cd8
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu,  8 Jun 2006 19:58:54 +0000

On Collection.changeParent(), change notify() action to 'move', and always send a three-value array in the order [collectionID, previousParent, newParent] -- 2nd or 3rd param will be null if moving from/to root


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/data_access.js | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -1155,17 +1155,15 @@ Scholar.Collection.prototype.changeParent = function(parent){ Scholar.DB.query(sql, [parentParam, {'int':this.getID()}]); this._parent = parent; - var notifyIDs = [this.getID()]; - if (previousParent){ - notifyIDs.push(previousParent); - } - if (parent){ - notifyIDs.push(parent); - } + var notifyIDs = [ + this.getID(), + (previousParent ? previousParent : null), + (parent ? parent : null) + ]; // TODO: only reload the necessary ones Scholar.Collections.reloadAll(); - Scholar.Notifier.trigger('modify', 'collection', notifyIDs); + Scholar.Notifier.trigger('move', 'collection', notifyIDs); return true; }