commit 5963c02dbb99829c33a7bbd556d62b732abfadbe
parent 9de6a55bce956b3b65941f632be379d8dc5e8179
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 12 May 2017 05:37:46 -0400
Fix "Display All Tags in This Library" (broken in fe186333b)
Diffstat:
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml
@@ -268,7 +268,7 @@
// Otherwise just update based on visibility
else {
// If only a few tags, regenerate buttons from scratch
- if (Object.keys(this.scope).length <= 100) {
+ if (this.filterToScope && Object.keys(this.scope).length <= 100) {
// If full set is currently displayed, store it for later
if (!this._tagsDiv) {
this._tagsDiv = tagsBox.firstChild;
diff --git a/test/tests/tagSelectorTest.js b/test/tests/tagSelectorTest.js
@@ -100,6 +100,45 @@ describe("Tag Selector", function () {
});
});
+
+ describe("#filterToScope", function () {
+ it("should show all tags in library when false", function* () {
+ var tagSelector = doc.getElementById('zotero-tag-selector');
+ tagSelector.filterToScope = false;
+
+ var collection = yield createDataObject('collection');
+ var item1 = createUnsavedDataObject('item');
+ item1.setTags([
+ {
+ tag: "A"
+ }
+ ]);
+ var item2 = createUnsavedDataObject('item', { collections: [collection.id] });
+ item2.setTags([
+ {
+ tag: "B"
+ }
+ ]);
+ var item3 = createUnsavedDataObject('item', { collections: [collection.id] });
+ item3.setTags([
+ {
+ tag: "C"
+ }
+ ]);
+ var promise = waitForTagSelector(win);
+ yield Zotero.DB.executeTransaction(function* () {
+ yield item1.save();
+ yield item2.save();
+ yield item3.save();
+ });
+ yield promise;
+
+ var tags = getRegularTags();
+ assert.sameMembers(tags, ['A', 'B', 'C']);
+ });
+ });
+
+
describe("#notify()", function () {
it("should add a tag when added to an item in the library root", function* () {
var promise, tagSelector;