Change collection notifier event to 'delete' instead of 'remove' to be consistent with item deletions (as opposed to merely removing items from collections, which uses 'remove')

This commit is contained in:
Dan Stillman 2006-10-11 04:20:05 +00:00
parent 6b65bf06a4
commit 081b544688
4 changed files with 14 additions and 7 deletions

View file

@ -106,9 +106,9 @@ Zotero.CollectionTreeView.prototype.notify = function(action, type, ids)
var madeChanges = false;
var ids = Zotero.flattenArguments(ids);
if(action == 'remove')
if(action == 'delete')
{
//Since a remove involves shifting of rows, we have to do it in order
//Since a delete involves shifting of rows, we have to do it in order
//sort the ids by row
var rows = new Array();

View file

@ -2360,7 +2360,7 @@ Zotero.Collection.prototype.erase = function(deleteItems){
// Clear deleted collection from internal memory
Zotero.Collections.unload(collections);
Zotero.Notifier.trigger('remove', 'collection', collections);
Zotero.Notifier.trigger('delete', 'collection', collections);
if (items.length){
Zotero.Notifier.trigger('delete', 'item', items);
}

View file

@ -52,9 +52,16 @@ Zotero.Notifier = new function(){
}
/**
* event - 'add', 'remove', 'modify'
* type - 'collection', 'search', 'item'
* ids - single id or array of ids
* Trigger a notification to the appropriate observers
*
* Possible values:
*
* event: 'add', 'modify', 'delete', 'move' (c, for changing parent),
* 'remove' (i, for removing from collections)
* type - 'collection', 'search', 'item'
* ids - single id or array of ids
*
* c = collection, s = search, i = item
**/
function trigger(event, type, ids){
if (_disabled){

View file

@ -644,7 +644,7 @@ Zotero.Searches = new function(){
Zotero.DB.query(sql);
Zotero.DB.commitTransaction();
Zotero.Notifier.trigger('remove', 'search', savedSearchID);
Zotero.Notifier.trigger('delete', 'search', savedSearchID);
}
}