mirror of
https://github.com/zotero/zotero.git
synced 2026-10-05 02:43:38 +00:00
Sort batch-edit value suggestions by frequency descending
And remove counts, which are confusing
This commit is contained in:
parent
3aba0ed231
commit
7751801c87
1 changed files with 5 additions and 4 deletions
|
|
@ -2041,8 +2041,10 @@
|
|||
}
|
||||
}
|
||||
let options = Object.keys(optionCounts);
|
||||
options.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base', numeric: true }));
|
||||
let optionLabels = options.map(o => `[${optionCounts[o]}] ${o}`);
|
||||
// Sort by frequency (most common first), then alphanumerically
|
||||
options.sort((a, b) =>
|
||||
optionCounts[b] - optionCounts[a]
|
||||
|| a.localeCompare(b, undefined, { sensitivity: 'base', numeric: true }));
|
||||
valueElement.multipleValues = true;
|
||||
valueElement.value = '';
|
||||
valueElement.placeholder = Zotero.getString('item-pane-batch-editing-multiple-values-placeholder');
|
||||
|
|
@ -2056,8 +2058,7 @@
|
|||
search: 'zotero-options',
|
||||
searchParam: JSON.stringify({
|
||||
search: 'zotero-options',
|
||||
options: optionLabels,
|
||||
optionValues: options,
|
||||
options: options,
|
||||
includeNoValue: true
|
||||
}),
|
||||
popup: 'PopupAutoComplete',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue