(frame, snippet)
| 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 | |
| 334 | function debounce(fn, delay = 50) { |
no test coverage detected