summaryrefslogtreecommitdiff
path: root/ext/bg/js/search-query-parser.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/search-query-parser.js')
-rw-r--r--ext/bg/js/search-query-parser.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js
index 42e53989..8dc2e30a 100644
--- a/ext/bg/js/search-query-parser.js
+++ b/ext/bg/js/search-query-parser.js
@@ -38,16 +38,16 @@ class QueryParser {
}
onMouseDown(e) {
- if (Frontend.isMouseButton('primary', e)) {
+ if (DOM.isMouseButtonPressed(e, 'primary')) {
this.clickScanPrevent = false;
}
}
onMouseUp(e) {
if (
- this.search.options.scanning.clickGlossary &&
+ this.search.options.scanning.enablePopupSearch &&
!this.clickScanPrevent &&
- Frontend.isMouseButton('primary', e)
+ DOM.isMouseButtonPressed(e, 'primary')
) {
const selectText = this.search.options.scanning.selectText;
this.onTermLookup(e, {disableScroll: true, selectText});
@@ -55,7 +55,7 @@ class QueryParser {
}
onMouseMove(e) {
- if (this.pendingLookup || Frontend.isMouseButton('primary', e)) {
+ if (this.pendingLookup || DOM.isMouseButtonDown(e, 'primary')) {
return;
}
@@ -63,7 +63,7 @@ class QueryParser {
const scanningModifier = scanningOptions.modifier;
if (!(
Frontend.isScanningModifierPressed(scanningModifier, e) ||
- (scanningOptions.middleMouse && Frontend.isMouseButton('auxiliary', e))
+ (scanningOptions.middleMouse && DOM.isMouseButtonDown(e, 'auxiliary'))
)) {
return;
}
@@ -107,7 +107,7 @@ class QueryParser {
}
getParseResult() {
- return this.parseResults.find(r => r.id === this.selectedParser);
+ return this.parseResults.find((r) => r.id === this.selectedParser);
}
async setText(text) {
@@ -134,7 +134,7 @@ class QueryParser {
});
}
if (this.search.options.parsing.enableMecabParser) {
- let mecabResults = await apiTextParseMecab(text, this.search.getOptionsContext());
+ const mecabResults = await apiTextParseMecab(text, this.search.getOptionsContext());
for (const mecabDictName in mecabResults) {
results.push({
name: `MeCab: ${mecabDictName}`,
@@ -216,11 +216,11 @@ class QueryParser {
static processParseResultForDisplay(result) {
return result.map((term) => {
- return term.filter(part => part.text.trim()).map((part) => {
+ return term.filter((part) => part.text.trim()).map((part) => {
return {
text: Array.from(part.text),
reading: part.reading,
- raw: !part.reading || !part.reading.trim(),
+ raw: !part.reading || !part.reading.trim()
};
});
});