mirror of
https://github.com/wenlzhang/obsidian-tag-index.git
synced 2026-07-22 05:44:03 +00:00
Improve code format
This commit is contained in:
parent
e7ea3dd50f
commit
9f08511539
1 changed files with 10 additions and 3 deletions
13
src/main.ts
13
src/main.ts
|
|
@ -115,9 +115,13 @@ export default class TagIndexPlugin extends Plugin {
|
|||
|
||||
onunload() {
|
||||
// Clean up resources when the plugin is disabled
|
||||
console.log('Unloading Tag Index plugin');
|
||||
console.log("Unloading Tag Index plugin");
|
||||
// Remove the context menu event listener
|
||||
document.removeEventListener("contextmenu", this.contextMenuHandler, true);
|
||||
document.removeEventListener(
|
||||
"contextmenu",
|
||||
this.contextMenuHandler,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
// Helper to find a tag at the cursor position
|
||||
|
|
@ -143,7 +147,10 @@ export default class TagIndexPlugin extends Plugin {
|
|||
|
||||
setupTagPaneContextMenu() {
|
||||
// This handler function gets the same menu that Tag Wrangler uses
|
||||
const handleContextMenu = (event: ExtendedMouseEvent, target: HTMLElement) => {
|
||||
const handleContextMenu = (
|
||||
event: ExtendedMouseEvent,
|
||||
target: HTMLElement,
|
||||
) => {
|
||||
// In the tag pane, the data-tag attribute contains the actual tag name
|
||||
const dataTag = target.getAttribute("data-tag");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue