Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
c94a24a984
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,23 @@
|
||||||
|
var copy= {
|
||||||
|
exec: (id) => {
|
||||||
|
var element = document.getElementById(id);
|
||||||
|
if (document.body.createTextRange) {
|
||||||
|
range = document.body.createTextRange();
|
||||||
|
range.moveToElementText(element);
|
||||||
|
range.select();
|
||||||
|
} else if (window.getSelection) {
|
||||||
|
selection = window.getSelection();
|
||||||
|
range = document.createRange();
|
||||||
|
range.selectNodeContents(element);
|
||||||
|
selection.removeAllRanges();
|
||||||
|
selection.addRange(range);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
document.execCommand('copy');
|
||||||
|
return true;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('unable to copy text');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue