MCPcopy
hub / github.com/callumalpass/tasknotes / handleCardClick

Method handleCardClick

src/bases/TaskListView.ts:2680–2707  ·  view source on GitHub ↗
(task: TaskInfo, event: MouseEvent)

Source from the content-addressed store, hash-verified

2678 }
2679
2680 private async handleCardClick(task: TaskInfo, event: MouseEvent): Promise<void> {
2681 // Check if this is a selection click (shift/ctrl/cmd or in selection mode)
2682 if (this.handleSelectionClick(event, task.path)) {
2683 return;
2684 }
2685
2686 if (this.plugin.settings.doubleClickAction === "none") {
2687 await this.executeSingleClickAction(task, event);
2688 return;
2689 }
2690
2691 const existingTimeout = this.clickTimeouts.get(task.path);
2692 if (existingTimeout) {
2693 window.clearTimeout(existingTimeout);
2694 this.clickTimeouts.delete(task.path);
2695 await this.executeDoubleClickAction(task, event);
2696 } else {
2697 // Use correct window for pop-out window support
2698 const win = this.containerEl.ownerDocument.defaultView || window;
2699 const timeout = win.setTimeout(() => {
2700 void (async () => {
2701 this.clickTimeouts.delete(task.path);
2702 await this.executeSingleClickAction(task, event);
2703 })();
2704 }, 250);
2705 this.clickTimeouts.set(task.path, timeout);
2706 }
2707 }
2708
2709 private async executeSingleClickAction(task: TaskInfo, event: MouseEvent): Promise<void> {
2710 if (event.ctrlKey || event.metaKey) {

Callers 1

handleActionClickMethod · 0.95

Calls 7

getMethod · 0.65
clearTimeoutMethod · 0.65
deleteMethod · 0.65
setTimeoutMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected