Skip to content

Commit 63eb064

Browse files
mcbenjemaak8s-ci-robot
authored andcommitted
update sweetAlert and fix scrolling after copy (#15542)
1 parent b7c8869 commit 63eb064

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

layouts/partials/css.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<link rel="stylesheet" href="/css/case-study-styles.css">
1818
{{- end }}
1919
<link rel="stylesheet" href="{{ "css/jquery-ui.min.css" | relURL }}">
20-
<link rel="stylesheet" href="{{ "css/sweetalert.min.css" | relURL }}">
2120
<link rel="stylesheet" href="{{ "css/callouts.css" | relURL }}">
2221
<link rel="stylesheet" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
2322
{{- if .Params.deprecated }}

layouts/partials/head.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
<script src="{{ "js/jquery-3.2.1.min.js" | relURL }}"></script>
3838
<script src="{{ "js/jquery-ui-1.12.1.min.js" | relURL }}"></script>
3939
<script src="{{ "js/bootstrap-4.3.1.min.js" | relURL }}"></script>
40-
<script src="{{ "js/sweetalert-1.1.3.min.js" | relURL }}"></script>
40+
<script src="{{ "js/sweetalert-2.1.2.min.js" | relURL }}"></script>
41+
4142
<script src="{{ "js/script.js" | relURL }}"></script>
4243
<script src="{{ "js/custom-jekyll/tags.js" | relURL }}"></script>
4344
{{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | relURL }}"></script><!-- custom js added -->

static/css/sweetalert.min.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

static/js/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ function copyCode(elem){
4040
try {
4141
succeed = document.execCommand("copy");
4242
} catch(e) {
43-
sweetAlert("Oh, no...","Sorry, your browser doesn't support document.execCommand('copy'), so we can't copy this code to your clipboard.");
43+
swal("Oh, no...","Sorry, your browser doesn't support document.execCommand('copy'), so we can't copy this code to your clipboard.");
4444
succeed = false;
4545
}
46-
if (succeed) sweetAlert("Copied to clipboard: ",elem);
46+
if (succeed) swal("Copied to clipboard: ",elem);
4747
return succeed;
4848
} else {
49-
sweetAlert("Oops!",elem + " not found when trying to copy code");
49+
swal("Oops!",elem + " not found when trying to copy code");
5050
return false;
5151
}
5252
}

0 commit comments

Comments
 (0)