|
@@ -7,19 +7,17 @@ function doCommand(command, value) {
|
|
if (command === 'paste') {
|
|
if (command === 'paste') {
|
|
textarea.focus();
|
|
textarea.focus();
|
|
document.execCommand('paste');
|
|
document.execCommand('paste');
|
|
- textarea.remove();
|
|
|
|
-
|
|
|
|
- return textarea.value;
|
|
|
|
- }
|
|
|
|
- if (command === 'copy') {
|
|
|
|
|
|
+ value = textarea.value;
|
|
|
|
+ } else if (command === 'copy') {
|
|
textarea.value = value;
|
|
textarea.value = value;
|
|
textarea.select();
|
|
textarea.select();
|
|
document.execCommand('copy');
|
|
document.execCommand('copy');
|
|
textarea.blur();
|
|
textarea.blur();
|
|
- textarea.remove();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- return '';
|
|
|
|
|
|
+ textarea.remove();
|
|
|
|
+
|
|
|
|
+ return value;
|
|
}
|
|
}
|
|
|
|
|
|
export default async function ({ data, id, label }) {
|
|
export default async function ({ data, id, label }) {
|