diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml index 6c76341fb..0b5d4c69b 100644 --- a/chrome/content/zotero/bindings/tagsbox.xml +++ b/chrome/content/zotero/bindings/tagsbox.xml @@ -32,6 +32,7 @@ + "view" @@ -120,6 +121,7 @@ rows.removeChild(rows.firstChild); var tags = this.item.getTags(); + this._tagColors = Zotero.Tags.getColors(); if(tags) { @@ -255,6 +257,11 @@ valueElement.appendChild(document.createTextNode(valueText)); } + // Tag color + if (color = this._tagColors[valueText]) { + valueElement.setAttribute('style', 'color:' + this._tagColors[valueText]); + } + return valueElement; ]]> diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index 68d8f79b6..dacdf1251 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -712,7 +712,25 @@ tagIDs = tagIDs.split('-'); var name = Zotero.Tags.getName(tagIDs[0]); Zotero.Tags.setColor(name, color); - this.refresh(); + + // Iterate through all windows, updating tag selector and tags box + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var enumerator = wm.getEnumerator("navigator:browser"); + while (enumerator.hasMoreElements()) { + var win = enumerator.getNext(); + if (!win.ZoteroPane) continue; + + var tagSelector = win.ZoteroPane.document.getElementById('zotero-tag-selector'); + var itemPane = win.ZoteroPane.document.getElementById('zotero-view-item'); + + tagSelector.refresh(); + + if (itemPane.selectedPanel.firstChild.getAttribute('id') == 'zotero-editpane-tags') { + var tagsBox = win.ZoteroPane.document.getElementById('zotero-editpane-tags'); + tagsBox.reload(); + } + } ]]> diff --git a/chrome/content/zotero/xpcom/data/tags.js b/chrome/content/zotero/xpcom/data/tags.js index d700d881b..b7cb9e0a7 100644 --- a/chrome/content/zotero/xpcom/data/tags.js +++ b/chrome/content/zotero/xpcom/data/tags.js @@ -446,7 +446,7 @@ Zotero.Tags = new function() { tagColors = JSON.stringify(tagColors); Zotero.Prefs.set('tagColors', tagColors); - _reloadTagColors() + _reloadTagColors(); Zotero.Notifier.trigger('redraw', 'item', []); }