mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Reload click handlers
This commit is contained in:
parent
e1ebd6ac91
commit
0ba38cc092
2 changed files with 10 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
this.observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
|
|
@ -270,6 +271,14 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
|
||||
reloadHandlers() {
|
||||
document.querySelectorAll('div.nav-folder-title-content')
|
||||
.forEach((element: HTMLElement) => {
|
||||
if (element.onclick) return;
|
||||
element.onclick = (event: MouseEvent) => handleFolderClick(event, this);
|
||||
});
|
||||
}
|
||||
|
||||
onunload() {
|
||||
console.log('unloading folder notes plugin');
|
||||
this.observer.disconnect();
|
||||
|
|
|
|||
|
|
@ -471,6 +471,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||
}
|
||||
});
|
||||
new Notice('Finished updating folder notes');
|
||||
this.plugin.reloadHandlers();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue