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

Function pollScroll

src/client/ejs.mjs:147–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145 let wrap = node.parentNode.insertBefore(elt("div", {"class": "editor-wrap"}), node)
146 let pollingScroll = null
147 function pollScroll() {
148 if (document.activeElement != editor.contentDOM) return
149 let rect = editor.dom.getBoundingClientRect()
150 if (rect.bottom < 0 || rect.top > innerHeight) editor.contentDOM.blur()
151 else pollingScroll = setTimeout(pollScroll, 500)
152 }
153 let sandbox = node.getAttribute("data-sandbox")
154 let context = {
155 wrap: wrap,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected