MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / openMenu

Function openMenu

src/client/ejs.mjs:197–212  ·  view source on GitHub ↗
(editor, node)

Source from the content-addressed store, hash-verified

195 }
196
197 function openMenu(editor, node) {
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 }
213
214 function runCode(editor) {
215 let context = editor.state.facet(contextFacet)

Callers

nothing calls this directly

Calls 1

eltFunction · 0.85

Tested by

no test coverage detected