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(); 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;
} }

View File

@ -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