Skip to content

Commit 7cd16ae

Browse files
yardenshohamdelvh
andauthored
Update web_src/js/features/common-global.js
Co-authored-by: delvh <[email protected]>
1 parent fc385dc commit 7cd16ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web_src/js/features/common-global.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,10 @@ export function initGlobalButtons() {
345345
});
346346

347347
// get raw text for copy content button
348+
const copyContentButtons = document.querySelectorAll('button.copy-content');
349+
if (copyContentButtons.length == 0) return;
348350
const text = Array.from(document.querySelectorAll('.lines-code')).map((el) => el.textContent).join('');
349-
for (const copyContentButton of document.querySelectorAll('button.copy-content')) {
351+
for (const copyContentButton of copyContentButtons) {
350352
copyContentButton.setAttribute('data-clipboard-text', text);
351353
}
352354
}

0 commit comments

Comments
 (0)