fix: remove redundancy in onload and onupdate
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
export function onLoad() {
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
export function onUpdate() {
|
export function onUpdate() {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@@ -38,10 +34,6 @@ function addClipboard() {
|
|||||||
const codeBlocks = document.querySelectorAll('pre');
|
const codeBlocks = document.querySelectorAll('pre');
|
||||||
|
|
||||||
codeBlocks.forEach((block) => {
|
codeBlocks.forEach((block) => {
|
||||||
if (block.querySelector('button.copy-button')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const button = document.createElement('button');
|
const button = document.createElement('button');
|
||||||
button.className = 'copy-button';
|
button.className = 'copy-button';
|
||||||
button.type = 'button';
|
button.type = 'button';
|
||||||
|
|||||||
Reference in New Issue
Block a user