New global JS helper copyToClipboard

This commit is contained in:
Gina Häußge 2017-08-22 18:05:53 +02:00
parent 76c2113ad4
commit b138c2bccf

View file

@ -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();
};