don't show busy spinner while waiting for card info
smoother cursor movement in firefox
This commit is contained in:
parent
84d2204d96
commit
0c650dac82
@ -21,7 +21,6 @@ class Frontend {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.popup = new Popup();
|
this.popup = new Popup();
|
||||||
this.popupTimer = null;
|
this.popupTimer = null;
|
||||||
this.mousePosLast = null;
|
|
||||||
this.mouseDownLeft = false;
|
this.mouseDownLeft = false;
|
||||||
this.mouseDownMiddle = false;
|
this.mouseDownMiddle = false;
|
||||||
this.textSourceLast = null;
|
this.textSourceLast = null;
|
||||||
@ -53,7 +52,6 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMouseMove(e) {
|
onMouseMove(e) {
|
||||||
this.mousePosLast = {x: e.clientX, y: e.clientY};
|
|
||||||
this.popupTimerClear();
|
this.popupTimerClear();
|
||||||
|
|
||||||
if (!this.options.general.enable) {
|
if (!this.options.general.enable) {
|
||||||
@ -64,6 +62,10 @@ class Frontend {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.pendingLookup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const mouseScan = this.mouseDownMiddle && this.options.scanning.middleMouse;
|
const mouseScan = this.mouseDownMiddle && this.options.scanning.middleMouse;
|
||||||
const keyScan =
|
const keyScan =
|
||||||
this.options.scanning.modifier === 'alt' && e.altKey ||
|
this.options.scanning.modifier === 'alt' && e.altKey ||
|
||||||
@ -75,11 +77,19 @@ class Frontend {
|
|||||||
return;
|
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') {
|
if (this.options.scanning.modifier === 'none') {
|
||||||
this.popupTimerSet(searchFunc);
|
this.popupTimerSet(search);
|
||||||
} else {
|
} else {
|
||||||
searchFunc();
|
search();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,8 +286,6 @@ class Display {
|
|||||||
|
|
||||||
async adderButtonUpdate(modes, sequence) {
|
async adderButtonUpdate(modes, sequence) {
|
||||||
try {
|
try {
|
||||||
this.spinner.show();
|
|
||||||
|
|
||||||
const states = await apiDefinitionsAddable(this.definitions, modes);
|
const states = await apiDefinitionsAddable(this.definitions, modes);
|
||||||
if (!states || sequence !== this.sequence) {
|
if (!states || sequence !== this.sequence) {
|
||||||
return;
|
return;
|
||||||
@ -308,8 +306,6 @@ class Display {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.onError(e);
|
this.onError(e);
|
||||||
} finally {
|
|
||||||
this.spinner.hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user