aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2019-09-02 11:47:14 -0700
committerAlex Yatskov <alex@foosoft.net>2019-09-02 11:47:14 -0700
commit5347da528bd07166b4686f45440d80a77f4888a3 (patch)
tree08bbfd0c859327ee9a08ca86afd222a222ced62b /ext/fg/js/frontend.js
parentda981c0b911dc5a697246006089b266fddba84a7 (diff)
parent4ac55da7dd5354e6c3495f04583352d0d863b7b6 (diff)
Merge branch 'master' into testing
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 3c5f2ac8..8a5c48d0 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -285,7 +285,7 @@ class Frontend {
return;
}
- const textSource = docRangeFromPoint(point);
+ const textSource = docRangeFromPoint(point, this.options);
let hideResults = !textSource || !textSource.containsPoint(point);
let searched = false;
let success = false;
@@ -301,16 +301,21 @@ class Frontend {
} catch (e) {
if (window.yomichan_orphaned) {
if (textSource && this.options.scanning.modifier !== 'none') {
- this.popup.showOrphaned(textSource.getRect(), this.options);
+ this.popup.showOrphaned(
+ textSource.getRect(),
+ textSource.getWritingMode(),
+ this.options
+ );
}
} else {
this.onError(e);
}
} finally {
+ if (textSource !== null) {
+ textSource.cleanup();
+ }
if (hideResults && this.options.scanning.autoHideResults) {
this.searchClear();
- } else {
- docImposterDestroy();
}
this.pendingLookup = false;
@@ -332,6 +337,7 @@ class Frontend {
const url = window.location.href;
this.popup.termsShow(
textSource.getRect(),
+ textSource.getWritingMode(),
definitions,
this.options,
{sentence, url, focus}
@@ -357,6 +363,7 @@ class Frontend {
const url = window.location.href;
this.popup.kanjiShow(
textSource.getRect(),
+ textSource.getWritingMode(),
definitions,
this.options,
{sentence, url, focus}
@@ -371,7 +378,6 @@ class Frontend {
}
searchClear() {
- docImposterDestroy();
this.popup.hide();
this.popup.clearAutoPlayTimer();