Move apiClipboardGet implementation into Backend
This commit is contained in:
parent
2fef2bf5a8
commit
11b300ab76
@ -93,10 +93,6 @@ function apiGetEnvironmentInfo() {
|
|||||||
return utilBackend()._onApiGetEnvironmentInfo();
|
return utilBackend()._onApiGetEnvironmentInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiClipboardGet() {
|
function apiClipboardGet() {
|
||||||
const clipboardPasteTarget = utilBackend().clipboardPasteTarget;
|
return utilBackend()._onApiClipboardGet();
|
||||||
clipboardPasteTarget.innerText = '';
|
|
||||||
clipboardPasteTarget.focus();
|
|
||||||
document.execCommand('paste');
|
|
||||||
return clipboardPasteTarget.innerText;
|
|
||||||
}
|
}
|
||||||
|
@ -475,8 +475,12 @@ class Backend {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiClipboardGet() {
|
async _onApiClipboardGet() {
|
||||||
return apiClipboardGet();
|
const clipboardPasteTarget = this.clipboardPasteTarget;
|
||||||
|
clipboardPasteTarget.innerText = '';
|
||||||
|
clipboardPasteTarget.focus();
|
||||||
|
document.execCommand('paste');
|
||||||
|
return clipboardPasteTarget.innerText;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command handlers
|
// Command handlers
|
||||||
|
Loading…
Reference in New Issue
Block a user