summaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-02-10 20:45:01 -0800
committerAlex Yatskov <alex@foosoft.net>2017-02-10 20:45:01 -0800
commit78d5b511278cd9b8f9319220bec55b8628f6cb36 (patch)
treed5f181b03c28adc06f705c1fa286bfdeaeb55cdf /ext/fg/js/driver.js
parentcaa09c63a18a0d5f30fda365c18c0d58235ec7e9 (diff)
fix url and sentence tags on kanji cards
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();