commit f5e55d21bfc57aad6f0dcd3621a862dbf01bcb01
parent 237db5ed586f705d508c96d978fcb6e97d8a3b27
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 22 Sep 2006 08:26:54 +0000
Closes #296, Delete from collection doesn't need warning
Still need #292, "Delete From Library" context menu option in collections
This may or may not help people understand that deleting from a collection doesn't by design delete from the library, but, regardless, this is the same behavior as iTunes.
Diffstat:
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js
@@ -264,6 +264,14 @@ var ScholarPane = new function()
{
if(itemsView && itemsView.selection.count > 0)
{
+ if (itemsView._itemGroup.isCollection()){
+ var noPrompt = true;
+ }
+ // Do nothing in search view
+ else if (itemsView._itemGroup.isSearch()){
+ return;
+ }
+
var eraseChildren = {value: true};
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
@@ -284,8 +292,8 @@ var ScholarPane = new function()
}
}
}
-
- if (promptService.confirmCheck(
+
+ if (noPrompt || promptService.confirmCheck(
window,
Scholar.getString('pane.items.delete.title'),
Scholar.getString('pane.items.delete' + (itemsView.selection.count>1 ? '.multiple' : '')),
diff --git a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js
@@ -562,7 +562,7 @@ Scholar.ItemTreeView.prototype.deleteSelection = function(eraseChildren)
this._treebox.beginUpdateBatch();
for (var i=0; i<items.length; i++)
{
- if(this._itemGroup.isLibrary() || !items[i].isRegularItem()) //erase item from DB
+ if(this._itemGroup.isLibrary()) //erase item from DB
items[i].ref.erase(eraseChildren);
else if(this._itemGroup.isCollection())
this._itemGroup.ref.removeItem(items[i].ref.getID());