aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-16 22:13:54 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-16 22:13:54 -0700
commit231b471f45505a8b8fc4a8b25aa685f6f877953c (patch)
treeb457c7fbe80948a5a69c054b0bcab7a67af79305 /ext/fg/js/driver.js
parent8893db14caa6d34117dcb7e38ec1af32baa89b95 (diff)
wip
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r--ext/fg/js/driver.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index fddfbc29..fbe89ab8 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -153,9 +153,12 @@ window.driver = new class {
const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);
const url = window.location.href;
-
- this.popup.showNextTo(textSource.getRect(), this.options);
- this.popup.showTermDefs(definitions, this.options, {sentence, url});
+ this.popup.showTermDefs(
+ textSource.getRect(),
+ definitions,
+ this.options,
+ {sentence, url}
+ );
this.lastTextSource = textSource;
if (this.options.scanning.selectText) {
@@ -176,9 +179,12 @@ window.driver = new class {
} else {
const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);
const url = window.location.href;
-
- this.popup.showNextTo(textSource.getRect(), this.options);
- this.popup.showKanjiDefs(definitions, this.options, {sentence, url});
+ this.popup.showKanjiDefs(
+ textSource.getRect(),
+ definitions,
+ this.options,
+ {sentence, url}
+ );
this.lastTextSource = textSource;
if (this.options.scanning.selectText) {
@@ -204,8 +210,7 @@ window.driver = new class {
handleError(error, textSource) {
if (window.orphaned) {
if (textSource && this.options.scanning.requireShift) {
- this.popup.showNextTo(textSource.getRect(), this.options);
- this.popup.showOrphaned();
+ this.popup.showOrphaned(textSource.getRect(), this.options);
}
} else {
window.alert(`Error: ${error}`);