make containsPoint async everywhere

This commit is contained in:
siikamiika 2019-08-28 01:08:45 +03:00 committed by toasted-nutbread
parent 71471d08e5
commit 87ff5cb19b
4 changed files with 4 additions and 12 deletions

View File

@ -294,7 +294,7 @@ class Frontend {
async searchAt(point, type) {
if (
this.pendingLookup ||
(this.popup.containsPointIsAsync() ? await this.popup.containsPointAsync(point) : this.popup.containsPoint(point))
await this.popup.containsPoint(point)
) {
return;
}

View File

@ -110,7 +110,7 @@ class PopupProxyHost {
async containsPoint(id, point) {
const popup = this.getPopup(id);
return popup.containsPointIsAsync() ? await popup.containsPointAsync(point) : popup.containsPoint(point);
return await popup.containsPoint(point);
}
async termsShow(id, elementRect, definitions, options, context) {

View File

@ -69,21 +69,13 @@ class PopupProxy {
return await this.invokeHostApi('setVisible', {id, visible});
}
containsPoint() {
throw 'Non-async function not supported';
}
async containsPointAsync(point) {
async containsPoint(point) {
if (this.id === null) {
return false;
}
return await this.invokeHostApi('containsPoint', {id: this.id, point});
}
containsPointIsAsync() {
return true;
}
async termsShow(elementRect, definitions, options, context) {
const id = await this.getPopupId();
elementRect = PopupProxy.DOMRectToJson(elementRect);

View File

@ -248,7 +248,7 @@ class Popup {
}
}
containsPoint(point) {
async containsPoint(point) {
if (!this.isVisible()) {
return false;
}