Skip to content

Commit 9ea6634

Browse files
committed
Fixed bug on copying with copyToClipboard
1 parent f53eb1b commit 9ea6634

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

public/assets/dashboard.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ loadTooltips();
1010

1111
function copyToClipboard(copyButtonId = 'copyButton') {
1212
// Find the <pre> tag content
13-
const codeContent = document.getElementById(copyButtonId + '-code').innerText;
13+
const codecontentId = copyButtonId + (copyButtonId !== 'copyButton' ? '-code' : '');
14+
const codeContent = document.getElementById(codecontentId).innerText;
1415

1516
// Create a temporary textarea element to hold the content
1617
const tempTextArea = document.createElement("textarea");

0 commit comments

Comments
 (0)