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) { async searchAt(point, type) {
if ( if (
this.pendingLookup || this.pendingLookup ||
(this.popup.containsPointIsAsync() ? await this.popup.containsPointAsync(point) : this.popup.containsPoint(point)) await this.popup.containsPoint(point)
) { ) {
return; return;
} }

View File

@ -110,7 +110,7 @@ class PopupProxyHost {
async containsPoint(id, point) { async containsPoint(id, point) {
const popup = this.getPopup(id); 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) { async termsShow(id, elementRect, definitions, options, context) {

View File

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

View File

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