Remove redundant call of popupTimerClear
Also use explicit null checks rather than truthy checks.
This commit is contained in:
parent
8b1e4d1c6f
commit
0067dfeacc
@ -77,7 +77,7 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMouseOver(e) {
|
onMouseOver(e) {
|
||||||
if (e.target === this.popup.container && this.popupTimer) {
|
if (e.target === this.popup.container && this.popupTimer !== null) {
|
||||||
this.popupTimerClear();
|
this.popupTimerClear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,12 +269,11 @@ class Frontend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
popupTimerSet(callback) {
|
popupTimerSet(callback) {
|
||||||
this.popupTimerClear();
|
|
||||||
this.popupTimer = window.setTimeout(callback, this.options.scanning.delay);
|
this.popupTimer = window.setTimeout(callback, this.options.scanning.delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
popupTimerClear() {
|
popupTimerClear() {
|
||||||
if (this.popupTimer) {
|
if (this.popupTimer !== null) {
|
||||||
window.clearTimeout(this.popupTimer);
|
window.clearTimeout(this.popupTimer);
|
||||||
this.popupTimer = null;
|
this.popupTimer = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user