Add code copy button
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
47b613cf43
commit
437fab1fe0
1 changed files with 2 additions and 2 deletions
|
@ -11,8 +11,8 @@ blocks.forEach((block) => {
|
||||||
button.innerText = copyButtonLabel;
|
button.innerText = copyButtonLabel;
|
||||||
block.appendChild(button);
|
block.appendChild(button);
|
||||||
|
|
||||||
button.addEventListener("click", async () => {
|
button.addEventListener("click", async (event) => {
|
||||||
await copyCode(block);
|
await copyCode(block, event.target);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue