MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / click

Function click

src/client/ejs.mjs:200–209  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

198 let menu = elt("div", {"class": "sandbox-open-menu"})
199 let context = editor.state.facet(contextFacet)
200 function click(e) {
201 let target = e.target
202 if (e.target.parentNode == menu) {
203 for (let i = 0; i < menu.childNodes.length; ++i)
204 if (target == menu.childNodes[i])
205 items[i][1]()
206 }
207 menu.parentNode.removeChild(menu)
208 window.removeEventListener("click", click)
209 }
210 setTimeout(() => window.addEventListener("click", click), 20)
211 node.offsetParent.appendChild(menu)
212 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected