mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Fix copy link function (#133)
This commit is contained in:
@@ -8,12 +8,10 @@
|
||||
|
||||
function copyLink(url) {
|
||||
if (!url || 0 === url.length) {
|
||||
return;
|
||||
url = window.location.href;
|
||||
}
|
||||
|
||||
url = window.location.href;
|
||||
|
||||
var $temp = $("<input>");
|
||||
|
||||
$("body").append($temp);
|
||||
$temp.val(url).select();
|
||||
document.execCommand("copy");
|
||||
@@ -21,4 +19,4 @@ function copyLink(url) {
|
||||
|
||||
alert("Link copied successfully!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user