Refactored instant loading setup

This commit is contained in:
squidfunk
2020-03-28 17:40:46 +01:00
parent 4d370fe903
commit edc9d6fc61
11 changed files with 114 additions and 116 deletions

View File

@@ -25,7 +25,7 @@ import { NEVER, Observable, Subject, fromEventPattern } from "rxjs"
import { mapTo, share, tap } from "rxjs/operators"
import { getElements } from "browser"
import { renderClipboard } from "templates"
import { renderClipboardButton } from "templates"
import { translate } from "utilities"
/* ----------------------------------------------------------------------------
@@ -66,7 +66,7 @@ export function setupClipboard(
blocks.forEach((block, index) => {
const parent = block.parentElement!
parent.id = `__code_${index}`
parent.insertBefore(renderClipboard(parent.id), block)
parent.insertBefore(renderClipboardButton(parent.id), block)
})
})