diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index 54919e112..608f49b4d 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -37,6 +37,7 @@ false null null + null false @@ -108,7 +109,7 @@ @@ -219,6 +220,16 @@ else { //Zotero.debug(5); labels[i].setAttribute('inScope', false); + + // If out of scope, make sure it's not selected (otherwise a tag + // stays selected after removing an item with that tag from the + // current collection) + if (this.selection[labels[i].value]) { + labels[i].setAttribute('selected', false); + delete this.selection[labels[i].value]; + var doCommand = true; + } + } labels[i].setAttribute('hidden', false); @@ -226,21 +237,37 @@ } } + this.updateNumSelected(); + this._empty = empty; this.id('tags-toggle').setAttribute('collapsed', empty); this.id('no-tags-box').setAttribute('collapsed', !empty); + + if (doCommand) { + Zotero.debug('A selected tag went out of scope -- deselecting'); + this.doCommand(); + } ]]> - + + + + + + + @@ -309,7 +358,7 @@ delete this.selection[labels[i].value]; } - // Bubbles up to command + this.doCommand(); ]]> @@ -539,7 +588,7 @@ + oncommand="this.parentNode.parentNode.parentNode.parentNode.clearAll(); event.stopPropagation();"/>