Skip to content

Commit f0c4459

Browse files
author
Ryan McGinnis
authored
Update script.js
In copyCode function, removes target.value from if (succeed) sweetAlert function. Sometimes target.value is too long, which causes the sweetAlert box to be cut off from the page. The confirmation button also gets cut off, which means that the user can't close the box, which means they need to refresh the page to continue. Instead, the alert tells the user which file was copied.
1 parent 67e4f54 commit f0c4459

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/script.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function copyCode(elem){
3535
sweetAlert("Oh, no...","Sorry, your browser doesn't support document.execCommand('copy'), so we can't copy this code to your clipboard.");
3636
succeed = false;
3737
}
38-
if (succeed) sweetAlert("Copied to clipboard:",target.value);
38+
if (succeed) sweetAlert("Copied to clipboard: ",elem);
3939
return succeed;
4040
} else {
4141
sweetAlert("Oops!",elem + " not found when trying to copy code");

0 commit comments

Comments
 (0)