update sweetAlert and fix scrolling after copy (#15542)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
b7c886938e
commit
63eb064d96
+3
-3
@@ -40,13 +40,13 @@ function copyCode(elem){
|
||||
try {
|
||||
succeed = document.execCommand("copy");
|
||||
} catch(e) {
|
||||
sweetAlert("Oh, no...","Sorry, your browser doesn't support document.execCommand('copy'), so we can't copy this code to your clipboard.");
|
||||
swal("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: ",elem);
|
||||
if (succeed) swal("Copied to clipboard: ",elem);
|
||||
return succeed;
|
||||
} else {
|
||||
sweetAlert("Oops!",elem + " not found when trying to copy code");
|
||||
swal("Oops!",elem + " not found when trying to copy code");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user