Move apiClipboardGet implementation into Backend

This commit is contained in:
toasted-nutbread 2019-12-09 21:59:18 -05:00
parent 2fef2bf5a8
commit 11b300ab76
2 changed files with 8 additions and 8 deletions

View File

@ -93,10 +93,6 @@ function apiGetEnvironmentInfo() {
return utilBackend()._onApiGetEnvironmentInfo();
}
async function apiClipboardGet() {
const clipboardPasteTarget = utilBackend().clipboardPasteTarget;
clipboardPasteTarget.innerText = '';
clipboardPasteTarget.focus();
document.execCommand('paste');
return clipboardPasteTarget.innerText;
function apiClipboardGet() {
return utilBackend()._onApiClipboardGet();
}

View File

@ -475,8 +475,12 @@ class Backend {
};
}
_onApiClipboardGet() {
return apiClipboardGet();
async _onApiClipboardGet() {
const clipboardPasteTarget = this.clipboardPasteTarget;
clipboardPasteTarget.innerText = '';
clipboardPasteTarget.focus();
document.execCommand('paste');
return clipboardPasteTarget.innerText;
}
// Command handlers