From 6db417e63e27da969c82bbedf523a9237fb68ccb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 12 Aug 2008 07:10:50 +0000 Subject: [PATCH] Improved subcollection support -- fixes "Cannot set parent of collection [x] to invalid parent [x]" error, among other things Removed child collections from XML -- now uses parent attribute exclusively -- and increased API version to 2 --- .../zotero/xpcom/collectionTreeView.js | 23 ++-- .../content/zotero/xpcom/data/collection.js | 91 +++++++++++---- chrome/content/zotero/xpcom/sync.js | 105 ++++++++++++++---- 3 files changed, 163 insertions(+), 56 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index cfc611d164..9cc25a6951 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -169,16 +169,7 @@ Zotero.CollectionTreeView.prototype.notify = function(action, type, ids) var madeChanges = false; - if (action == 'refresh') { - switch (type) { - case 'share': - this.reload(); - this.rememberSelection(savedSelection); - break; - } - } - - else if(action == 'delete') { + if (action == 'delete') { //Since a delete involves shifting of rows, we have to do it in order //sort the ids by row @@ -222,8 +213,9 @@ Zotero.CollectionTreeView.prototype.notify = function(action, type, ids) for (var i=0; i; + var collectionIDHash = {}; + + for (var i=0; i