Revert "Don't refresh item list upon tag selector actions unless the action changes the item list."
This reverts commit 7f732f56df
.
This commit is contained in:
parent
b3640a8ae1
commit
39e8b226cb
3 changed files with 4 additions and 18 deletions
|
@ -2198,19 +2198,14 @@ Zotero.ItemGroup.prototype.getChildTags = function() {
|
|||
|
||||
Zotero.ItemGroup.prototype.setSearch = function(searchText)
|
||||
{
|
||||
if(searchText === this.searchText) return false;
|
||||
Zotero.ItemGroupCache.clear();
|
||||
this.searchText = searchText;
|
||||
return true;
|
||||
}
|
||||
|
||||
Zotero.ItemGroup.prototype.setTags = function(tags)
|
||||
{
|
||||
if((!tags || Zotero.Utilities.isEmpty(tags))
|
||||
&& (!this.tags || Zotero.Utilities.isEmpty(this.tags))) return false;
|
||||
Zotero.ItemGroupCache.clear();
|
||||
this.tags = Zotero.Utilities.deepCopy(tags);
|
||||
return true;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1733,18 +1733,16 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
|
|||
var savedOpenState = this.saveOpenState();
|
||||
var savedFirstRow = this.saveFirstRow();
|
||||
|
||||
var isDirty;
|
||||
switch (type) {
|
||||
case 'search':
|
||||
isDirty = this._itemGroup.setSearch(data);
|
||||
this._itemGroup.setSearch(data);
|
||||
break;
|
||||
case 'tags':
|
||||
isDirty = this._itemGroup.setTags(data);
|
||||
this._itemGroup.setTags(data);
|
||||
break;
|
||||
default:
|
||||
throw ('Invalid filter type in setFilter');
|
||||
}
|
||||
if(!isDirty) return false;
|
||||
var oldCount = this.rowCount;
|
||||
this.refresh();
|
||||
|
||||
|
@ -1759,7 +1757,6 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) {
|
|||
|
||||
//Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4);
|
||||
this._runCallbacks();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1037,13 +1037,7 @@ var ZoteroPane = new function()
|
|||
*/
|
||||
function updateTagFilter(){
|
||||
if (this.itemsView) {
|
||||
// If setFilter returns false, that means the tags didn't change. In that
|
||||
// case, callbacks don't get called, so we need to update tags in the tag
|
||||
// selector on our own.
|
||||
if(!this.itemsView.setFilter('tags', getTagSelection())) {
|
||||
var tagSelector = document.getElementById('zotero-tag-selector');
|
||||
tagSelector.refresh();
|
||||
}
|
||||
this.itemsView.setFilter('tags', getTagSelection());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue