New global JS helper copyToClipboard
This commit is contained in:
parent
76c2113ad4
commit
b138c2bccf
1 changed files with 8 additions and 0 deletions
|
|
@ -1120,3 +1120,11 @@ var escapeUnprintableCharacters = function(str) {
|
|||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
var copyToClipboard = function(text) {
|
||||
var temp = $("<input>");
|
||||
$("body").append(temp);
|
||||
temp.val(text).select();
|
||||
document.execCommand("copy");
|
||||
temp.remove();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue