Enhanced JS function.
This commit is contained in:
parent
9935f76530
commit
4c631f6839
2 changed files with 4 additions and 3 deletions
|
@ -6,8 +6,9 @@
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function copyLink() {
|
function copyLink(url) {
|
||||||
var url = window.location.href;
|
if (!url || 0 === url.length)
|
||||||
|
url = window.location.href;
|
||||||
var $temp = $("<input>");
|
var $temp = $("<input>");
|
||||||
|
|
||||||
$("body").append($temp);
|
$("body").append($temp);
|
||||||
|
|
2
assets/js/dist/_commons/copy-link.min.js
vendored
2
assets/js/dist/_commons/copy-link.min.js
vendored
|
@ -1 +1 @@
|
||||||
function copyLink(){var a=window.location.href;var b=$("<input>");$("body").append(b);b.val(a).select();document.execCommand("copy");b.remove();alert("Link copied successfully!")};
|
function copyLink(a){if(!a||0===a.length){a=window.location.href}var b=$("<input>");$("body").append(b);b.val(a).select();document.execCommand("copy");b.remove();alert("Link copied successfully!")};
|
Loading…
Reference in a new issue