From f2dec4ca20c1eddeda86ceb5c13795d4bacf19d6 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 24 Oct 2019 21:05:29 -0400 Subject: Remove searchFromTouch --- ext/fg/js/frontend.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'ext/fg/js/frontend.js') diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 07c1f0dc..bc4e8cc3 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -197,7 +197,7 @@ class Frontend { } const touch = touches[index]; - this.searchFromTouch(touch.clientX, touch.clientY, 'touchMove'); + this.searchAt(touch.clientX, touch.clientY, 'touchMove'); e.preventDefault(); // Disable scroll } @@ -293,6 +293,8 @@ class Frontend { async searchAt(x, y, cause) { try { + this.popupTimerClear(); + if (this.pendingLookup || await this.popup.containsPoint(x, y)) { return; } @@ -449,7 +451,7 @@ class Frontend { const textSourceCurrentPrevious = this.textSourceCurrent !== null ? this.textSourceCurrent.clone() : null; - this.searchFromTouch(touch.clientX, touch.clientY, 'touchStart') + this.searchAt(touch.clientX, touch.clientY, 'touchStart') .then(() => { if ( this.pendingLookup || @@ -482,16 +484,6 @@ class Frontend { this.clickPrevent = value; } - searchFromTouch(x, y, cause) { - this.popupTimerClear(); - - if (this.pendingLookup) { - return Promise.resolve(); - } - - return this.searchAt(x, y, cause); - } - selectionContainsPoint(selection, x, y) { for (let i = 0; i < selection.rangeCount; ++i) { const range = selection.getRangeAt(i); -- cgit v1.2.3