aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/api.js4
-rw-r--r--ext/mixed/js/text-scanner.js12
2 files changed, 6 insertions, 10 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index 56e6a715..7080d93a 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -44,10 +44,6 @@ function apiTextParse(text, optionsContext) {
return _apiInvoke('textParse', {text, optionsContext});
}
-function apiTextParseMecab(text, optionsContext) {
- return _apiInvoke('textParseMecab', {text, optionsContext});
-}
-
function apiKanjiFind(text, optionsContext) {
return _apiInvoke('kanjiFind', {text, optionsContext});
}
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index a1d96320..0cd12cd7 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -46,7 +46,7 @@ class TextScanner {
}
onMouseOver(e) {
- if (this.ignoreElements.includes(e.target)) {
+ if (this.ignoreElements().includes(e.target)) {
this.scanTimerClear();
}
}
@@ -133,7 +133,7 @@ class TextScanner {
this.preventNextClick = false;
const primaryTouch = e.changedTouches[0];
- if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, this.node.getSelection())) {
+ if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, window.getSelection())) {
return;
}
@@ -224,8 +224,8 @@ class TextScanner {
}
}
- setEnabled(enabled) {
- if (enabled) {
+ setEnabled(enabled, canEnable) {
+ if (enabled && canEnable) {
if (!this.enabled) {
this.hookEvents();
this.enabled = true;
@@ -271,9 +271,9 @@ class TextScanner {
];
}
- setOptions(options) {
+ setOptions(options, canEnable=true) {
this.options = options;
- this.setEnabled(this.options.general.enable);
+ this.setEnabled(this.options.general.enable, canEnable);
}
async searchAt(x, y, cause) {