From bd8cae6fdd69575cfc6af9bb0908c82f0e68b378 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Wed, 6 Nov 2024 05:38:05 -0800 Subject: [PATCH] qf: show recently modified notes when empty input (#4797) Fixes: #4771 --- chrome/content/zotero/integration/quickFormat.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index ffa93c8552..449e1e97d0 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -352,8 +352,10 @@ var Zotero_QuickFormat = new function () { _openReferencePanel(); return; } - // Otherwise, run the search if the input is non-empty. - if (!isInputEmpty(newInput)) { + // Otherwise, run the search if the input is non-empty + // or if we are citing notes (in which case, if the input is empty, + // most-recently modified notes are displayed) + if (!isInputEmpty(newInput) || Zotero_QuickFormat.citingNotes) { _resetSearchTimer(); } else { @@ -700,7 +702,7 @@ var Zotero_QuickFormat = new function () { selectedItems = Zotero.getActiveZoteroPane().getSelectedItems().filter(i => i.isNote()); } } - if (!searchString) { + if (!searchString && selectedItems.length) { return [selectedItems, []]; } else if (!searchResultIDs.length) {