From 4e1fbf9747bd6d3694b5446fd2ccf90d30b10231 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 14 Mar 2013 20:06:34 -0400 Subject: [PATCH] Fix clearing selected tag when removed from last item in view I somehow broke this in d2f028d797c5c0ae3d77d54a5bbabaa5cd4a961b, though I'm not sure how. --- chrome/content/zotero/bindings/tagselector.xml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index 45d63bccf..65cfae700 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -279,6 +279,14 @@ break; } } + + // If tag isn't in scope and is still selected, + // deselect it + if (!inScope && self.selection[labels[i].value]) { + labels[i].setAttribute('selected', false); + delete self.selection[labels[i].value]; + var doCommand = true; + } } // If not in filter, hide @@ -303,16 +311,6 @@ } else { 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 (self.selection[labels[i].value]) { - labels[i].setAttribute('selected', false); - delete self.selection[labels[i].value]; - var doCommand = true; - } - } labels[i].setAttribute('hidden', false);