MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / onClick

Function onClick

packages/app-core/src/components/NoteHoverPreview.tsx:98–114  ·  view source on GitHub ↗
(e: MouseEvent)

Source from the content-addressed store, hash-verified

96 if (!root || !html) return
97
98 const onClick = (e: MouseEvent): void => {
99 const target = e.target as HTMLElement
100 const copyButton = target.closest<HTMLButtonElement>(CODE_COPY_BUTTON_SELECTOR)
101 if (copyButton) {
102 e.preventDefault()
103 e.stopPropagation()
104 copyCodeBlockToClipboard(copyButton)
105 return
106 }
107
108 const foldButton = target.closest<HTMLButtonElement>(CODE_FOLD_BUTTON_SELECTOR)
109 if (foldButton) {
110 e.preventDefault()
111 e.stopPropagation()
112 toggleCodeBlockFold(foldButton)
113 }
114 }
115
116 root.addEventListener('click', onClick)
117 return () => root.removeEventListener('click', onClick)

Callers

nothing calls this directly

Calls 2

copyCodeBlockToClipboardFunction · 0.90
toggleCodeBlockFoldFunction · 0.90

Tested by

no test coverage detected