From f0c445980d5c58b7706f13bc84e749c7e080cbaf Mon Sep 17 00:00:00 2001 From: Ryan McGinnis Date: Tue, 27 Jun 2017 08:58:02 -0700 Subject: [PATCH] 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. --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 9b9dde3958..21e8012399 100755 --- a/js/script.js +++ b/js/script.js @@ -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");