From 9e5c15423a0e8248e6b263755d268ad84390d6f6 Mon Sep 17 00:00:00 2001 From: David Norton Date: Mon, 7 Aug 2006 15:25:29 +0000 Subject: [PATCH] Fixes #164, On item delete, if "Erase Files" is not checked, it still shows files and notes being deleted. If you are simple removing an item from a project, it won't ask you if you want to delete files and notes. ItemTreeView: - notify() now works with multiple ids for action=modify. - saveSelection() returns an array of selected IDs instead of saving it to a class variable - rememberSelection(selection) takes an array of IDs. --- .../content/scholar/itemTreeView.js | 70 ++++++++++++------- chrome/chromeFiles/content/scholar/overlay.js | 17 +++-- 2 files changed, 55 insertions(+), 32 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index 69a4e2f7c4..fe6187f263 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -34,7 +34,6 @@ Scholar.ItemTreeView = function(itemGroup) this._itemGroup = itemGroup; this._treebox = null; - this._savedSelection = null; this.refresh(); this._unregisterID = Scholar.Notifier.registerItemTree(this); @@ -82,9 +81,9 @@ Scholar.ItemTreeView.prototype.refresh = function() Scholar.ItemTreeView.prototype.notify = function(action, type, ids) { var madeChanges = false; - + this.selection.selectEventsSuppressed = true; - this.saveSelection(); + var savedSelection = this.saveSelection(); if((action == 'remove' && !this._itemGroup.isLibrary()) || (action == 'delete' && this._itemGroup.isLibrary())) { @@ -117,19 +116,40 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids) } else if(action == 'modify') //must check for null because it could legitimately be 0 { - var row = this._itemRowMap[ids]; - if( row != null) + ids = Scholar.flattenArguments(ids); + + for(var i=0, len=ids.length; i