commit 4e1fbf9747bd6d3694b5446fd2ccf90d30b10231
parent d60b0221db46bde6143aee3a13f534287f4b2a72
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 14 Mar 2013 20:06:34 -0400
Fix clearing selected tag when removed from last item in view
I somehow broke this in d2f028d797c5c0ae3d77d54a5bbabaa5cd4a961b, though
I'm not sure how.
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git 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);