commit 6b7fe8053a4a266a3bcb43baa819f48a020ee4e1
parent ce2828773b7dd543451d94040f5bc48988e65f53
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 21 Apr 2013 03:06:35 -0400
Fix UI update when adding/removing colored tags in search modes
https://forums.zotero.org/discussion/28827/404-colored-tag-search-results/
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js
@@ -54,7 +54,9 @@ Zotero.ItemTreeView = function(itemGroup, sourcesOnly)
this._dataItems = [];
this._itemImages = {};
- this._unregisterID = Zotero.Notifier.registerObserver(this, ['item', 'collection-item', 'share-items', 'bucket']);
+ this._unregisterID = Zotero.Notifier.registerObserver(
+ this, ['item', 'collection-item', 'item-tag', 'share-items', 'bucket']
+ );
}
@@ -434,6 +436,14 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
return;
}
+ // Clear item type icon and tag colors
+ if (type == 'item-tag') {
+ ids.map(function (val) val.split("-")[0]).forEach(function (val) {
+ delete this._itemImages[val];
+ }.bind(this));
+ return;
+ }
+
var itemGroup = this._itemGroup;
var madeChanges = false;
@@ -599,8 +609,6 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
this._refreshHashMap();
}
var row = this._itemRowMap[id];
- // Clear item type icon and tag colors
- delete this._itemImages[id];
// Deleted items get a modify that we have to ignore when
// not viewing the trash