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

Function placeFrame

src/client/ejs.mjs:317–331  ·  view source on GitHub ↗
(frame, snippet)

Source from the content-addressed store, hash-verified

315 }
316
317 function placeFrame(frame, snippet) {
318 let wrap = snippet.previousSibling, bot
319 if (!wrap || wrap.className != "editor-wrap") {
320 bot = snippet.getBoundingClientRect().bottom
321 activateCode(snippet, "html")
322 wrap = snippet.previousSibling
323 } else {
324 bot = wrap.getBoundingClientRect().bottom
325 }
326 wrap.insertBefore(frame, wrap.childNodes[1])
327 if (bot < 50) {
328 let newBot = wrap.getBoundingClientRect().bottom
329 window.scrollBy(0, newBot - bot)
330 }
331 }
332}
333
334function debounce(fn, delay = 50) {

Callers 1

getSandboxFunction · 0.85

Calls 1

activateCodeFunction · 0.85

Tested by

no test coverage detected