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.
This commit is contained in:
Ryan McGinnis 2017-06-27 08:58:02 -07:00 committed by GitHub
parent 67e4f54aaa
commit f0c445980d
1 changed files with 1 additions and 1 deletions

View File

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