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

Method resizeFrame

src/client/sandbox.mjs:221–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219 }
220
221 resizeFrame() {
222 this.frame.style.height = Math.max(80, Math.min(this.win.document.documentElement.offsetHeight + 2, 500)) + "px"
223 let box = this.frame.getBoundingClientRect()
224 if (box.bottom > box.top && box.top >= 0 && box.top < window.innerHeight && box.bottom > window.innerHeight) {
225 window.scrollBy(0, Math.min(box.top, box.bottom - window.innerHeight))
226 }
227 }
228
229 tick() {
230 let now = Date.now()

Callers 2

resizeMethod · 0.95
setHTMLMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected