summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-14 14:31:21 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-14 14:31:21 -0400
commit7dddcb8dca226e79453aa7734c99df1b18af4366 (patch)
tree5c5185e20e81ac7bf13edf3c58a5ba4b315617a8 /ext
parent6d3037f3d6548b742fa73aec7504c4384f327674 (diff)
Rename type to cause
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/js/frontend.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index a6919b37..31b43ad3 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -219,8 +219,8 @@ class Frontend {
}
}
- onAfterSearch(newRange, type, searched, success) {
- if (type === 'mouse') {
+ onAfterSearch(newRange, cause, searched, success) {
+ if (cause === 'mouse') {
return;
}
@@ -230,7 +230,7 @@ class Frontend {
return;
}
- if (type === 'touchStart' && newRange !== null) {
+ if (cause === 'touchStart' && newRange !== null) {
this.scrollPrevent = true;
}
@@ -280,7 +280,7 @@ class Frontend {
}
}
- async searchAt(x, y, type) {
+ async searchAt(x, y, cause) {
if (this.pendingLookup || await this.popup.containsPoint(x, y)) {
return;
}
@@ -294,7 +294,7 @@ class Frontend {
if (!hideResults && (!this.textSourceLast || !this.textSourceLast.equals(textSource))) {
searched = true;
this.pendingLookup = true;
- const focus = (type === 'mouse');
+ const focus = (cause === 'mouse');
hideResults = !await this.searchTerms(textSource, focus) && !await this.searchKanji(textSource, focus);
success = true;
}
@@ -319,7 +319,7 @@ class Frontend {
}
this.pendingLookup = false;
- this.onAfterSearch(this.textSourceLast, type, searched, success);
+ this.onAfterSearch(this.textSourceLast, cause, searched, success);
}
}
@@ -461,7 +461,7 @@ class Frontend {
this.clickPrevent = value;
}
- searchFromTouch(x, y, type) {
+ searchFromTouch(x, y, cause) {
this.popupTimerClear();
if (!this.options.general.enable || this.pendingLookup) {
@@ -470,7 +470,7 @@ class Frontend {
const search = async () => {
try {
- await this.searchAt(x, y, type);
+ await this.searchAt(x, y, cause);
} catch (e) {
this.onError(e);
}