aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r--ext/fg/js/driver.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index cb7f2ea6..c84805d7 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -143,13 +143,11 @@ class Driver {
textSource.setEndOffset(length);
const sentence = extractSentence(textSource, this.options.anki.sentenceExt);
- definitions.forEach(definition => {
- definition.url = window.location.href;
- definition.sentence = sentence;
- });
+ const url = window.location.href;
this.popup.showNextTo(textSource.getRect());
- this.popup.showTermDefs(definitions, this.options);
+ this.popup.showTermDefs(definitions, this.options, {sentence, url});
+
this.lastTextSource = textSource;
if (this.options.scanning.selectText) {
textSource.select();
@@ -168,13 +166,11 @@ class Driver {
return false;
} else {
const sentence = extractSentence(textSource, this.options.anki.sentenceExt);
- definitions.forEach(definition => {
- definition.url = window.location.href;
- definition.sentence = sentence;
- });
+ const url = window.location.href;
this.popup.showNextTo(textSource.getRect());
- this.popup.showKanjiDefs(definitions, this.options);
+ this.popup.showKanjiDefs(definitions, this.options, {sentence, url});
+
this.lastTextSource = textSource;
if (this.options.scanning.selectText) {
textSource.select();