Citation dialog: Use "All Fields & Tags Mode" in Library Mode

Quick fix for #5090
This commit is contained in:
Dan Stillman 2025-03-11 08:03:54 -04:00
parent 9cdfadbbae
commit b78bf8e24b
3 changed files with 8 additions and 3 deletions

View file

@ -277,7 +277,7 @@ class Layout {
while (!this.itemsView.collectionTreeRow) {
await Zotero.Promise.delay(10);
}
await this.itemsView.setFilter('search', value);
await this.itemsView.setFilter('citation-search', value);
}
SearchHandler.searching = false;

View file

@ -1603,6 +1603,9 @@ var ItemTree = class ItemTree extends LibraryTree {
case 'search':
this.collectionTreeRow.setSearch(data);
break;
case 'citation-search':
this.collectionTreeRow.setSearch(data, 'fields');
break;
case 'tags':
this.collectionTreeRow.setTags(data);
break;

View file

@ -428,7 +428,8 @@ Zotero.CollectionTreeRow.prototype.getSearchObject = Zotero.Promise.coroutine(fu
s2.setScope(s, includeScopeChildren);
if (this.searchText) {
var cond = 'quicksearch-' + Zotero.Prefs.get('search.quicksearch-mode');
let cond = 'quicksearch-'
+ (this.searchMode || Zotero.Prefs.get('search.quicksearch-mode'));
s2.addCondition(cond, 'contains', this.searchText);
}
@ -470,9 +471,10 @@ Zotero.CollectionTreeRow.prototype.getTags = async function (types, tagIDs) {
};
Zotero.CollectionTreeRow.prototype.setSearch = function (searchText) {
Zotero.CollectionTreeRow.prototype.setSearch = function (searchText, mode = null) {
Zotero.CollectionTreeCache.clear();
this.searchText = searchText;
this.searchMode = mode;
}
Zotero.CollectionTreeRow.prototype.setTags = function (tags) {