From 38bf9d858bf6b3fb47a8cfee3c66f2a31e7671d5 Mon Sep 17 00:00:00 2001 From: Quorafind Date: Thu, 25 May 2023 11:17:34 +0800 Subject: [PATCH] feat: support click to collapse --- src/floatSearchIndex.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/floatSearchIndex.ts b/src/floatSearchIndex.ts index 7ab178a..0a14b03 100644 --- a/src/floatSearchIndex.ts +++ b/src/floatSearchIndex.ts @@ -1,10 +1,11 @@ import { + apiVersion, App, Editor, MarkdownView, Menu, Modal, Notice, OpenViewState, - Plugin, SearchView, + Plugin, requireApiVersion, SearchView, TAbstractFile, TFile, Workspace, @@ -588,6 +589,9 @@ class FloatSearchModal extends Modal { if(e.altKey || !this.fileLeaf) { while (targetElement) { + if (targetElement.classList.contains('tree-item-icon')) { + break; + } if (targetElement.classList.contains('tree-item')) { this.close(); break;