Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 3f98380

Browse files
committed
feat(click handler): add option to expand collasped folder with note while opening it
disabled by default close #32
1 parent a4742e1 commit 3f98380

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/click-handler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export const getClickHandler = (plugin: ALxFolderNote) => {
4848
createNew || evt.type === "auxclick",
4949
{ active: true },
5050
);
51+
if (plugin.settings.expandFolderOnClick && item.collapsed)
52+
await item.setCollapsed(false);
5153
return true;
5254
} catch (error) {
5355
console.error(error);

src/settings.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface ALxFolderNoteSettings {
2323
folderNoteTemplate: string | null;
2424
mobileClickToOpen: boolean;
2525
longPressDelay: number;
26+
expandFolderOnClick: boolean;
2627
}
2728

2829
export const DEFAULT_SETTINGS: ALxFolderNoteSettings = {
@@ -38,6 +39,7 @@ export const DEFAULT_SETTINGS: ALxFolderNoteSettings = {
3839
folderNoteTemplate: null,
3940
mobileClickToOpen: true,
4041
longPressDelay: 800,
42+
expandFolderOnClick: false,
4143
};
4244

4345
type SettingKeyWithType<T> = {
@@ -118,6 +120,11 @@ export class ALxFolderNoteSettingTab extends PluginSettingTab {
118120
this.setFolderIcon();
119121
this.setModifier();
120122
this.setHide();
123+
this.addToggle(this.containerEl, "expandFolderOnClick")
124+
.setName("Expand Folder on Click")
125+
.setDesc(
126+
"Expand collapsed folders with note while opening them by clicking on folder title",
127+
);
121128
this.setMobile();
122129
this.setFocus();
123130

0 commit comments

Comments
 (0)