summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/frontend.js20
-rw-r--r--ext/mixed/js/display.js4
2 files changed, 15 insertions, 9 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 58a721bf..41c93f00 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -21,7 +21,6 @@ class Frontend {
constructor() {
this.popup = new Popup();
this.popupTimer = null;
- this.mousePosLast = null;
this.mouseDownLeft = false;
this.mouseDownMiddle = false;
this.textSourceLast = null;
@@ -53,7 +52,6 @@ class Frontend {
}
onMouseMove(e) {
- this.mousePosLast = {x: e.clientX, y: e.clientY};
this.popupTimerClear();
if (!this.options.general.enable) {
@@ -64,6 +62,10 @@ class Frontend {
return;
}
+ if (this.pendingLookup) {
+ return;
+ }
+
const mouseScan = this.mouseDownMiddle && this.options.scanning.middleMouse;
const keyScan =
this.options.scanning.modifier === 'alt' && e.altKey ||
@@ -75,11 +77,19 @@ class Frontend {
return;
}
- const searchFunc = () => this.searchAt(this.mousePosLast);
+ const search = async () => {
+ try {
+ await this.searchAt({x: e.clientX, y: e.clientY});
+ this.pendingLookup = false;
+ } catch (e) {
+ this.onError(e);
+ }
+ };
+
if (this.options.scanning.modifier === 'none') {
- this.popupTimerSet(searchFunc);
+ this.popupTimerSet(search);
} else {
- searchFunc();
+ search();
}
}
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 12950dfd..47efd195 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -286,8 +286,6 @@ class Display {
async adderButtonUpdate(modes, sequence) {
try {
- this.spinner.show();
-
const states = await apiDefinitionsAddable(this.definitions, modes);
if (!states || sequence !== this.sequence) {
return;
@@ -308,8 +306,6 @@ class Display {
}
} catch (e) {
this.onError(e);
- } finally {
- this.spinner.hide();
}
}