Fix "Display All Tags in This Library" (broken in fe186333b
)
This commit is contained in:
parent
9de6a55bce
commit
5963c02dbb
2 changed files with 40 additions and 1 deletions
|
@ -268,7 +268,7 @@
|
||||||
// Otherwise just update based on visibility
|
// Otherwise just update based on visibility
|
||||||
else {
|
else {
|
||||||
// If only a few tags, regenerate buttons from scratch
|
// 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 full set is currently displayed, store it for later
|
||||||
if (!this._tagsDiv) {
|
if (!this._tagsDiv) {
|
||||||
this._tagsDiv = tagsBox.firstChild;
|
this._tagsDiv = tagsBox.firstChild;
|
||||||
|
|
|
@ -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 () {
|
describe("#notify()", function () {
|
||||||
it("should add a tag when added to an item in the library root", function* () {
|
it("should add a tag when added to an item in the library root", function* () {
|
||||||
var promise, tagSelector;
|
var promise, tagSelector;
|
||||||
|
|
Loading…
Add table
Reference in a new issue