mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
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:
parent
6b65bf06a4
commit
081b544688
4 changed files with 14 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue