diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-02-10 20:45:01 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-02-10 20:45:01 -0800 |
commit | 78d5b511278cd9b8f9319220bec55b8628f6cb36 (patch) | |
tree | d5f181b03c28adc06f705c1fa286bfdeaeb55cdf /ext/fg/js/driver.js | |
parent | caa09c63a18a0d5f30fda365c18c0d58235ec7e9 (diff) |
fix url and sentence tags on kanji cards
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r-- | ext/fg/js/driver.js | 16 |
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(); |