👌 IMPROVE: Frontend refactoring, fixes etc

This commit is contained in:
Divlo
2020-05-01 21:01:03 +02:00
parent c36b0a46ab
commit 650bcac05a
6 changed files with 9 additions and 13 deletions

View File

@ -1,10 +1,10 @@
function copyToClipboard(text) {
const elem = document.createElement('textarea');
elem.value = text;
document.body.appendChild(elem);
elem.select();
const element = document.createElement('textarea');
element.value = text;
document.body.appendChild(element);
element.select();
document.execCommand('copy');
document.body.removeChild(elem);
document.body.removeChild(element);
}
export default copyToClipboard;