summaryrefslogtreecommitdiff
path: root/ext/fg/js/frame.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-02-08 20:13:45 -0800
committerAlex Yatskov <alex@foosoft.net>2017-02-08 20:13:45 -0800
commit2e3aec9ba11b15d7ac2b5d99af2dacac88e9c276 (patch)
tree20b47cc94b727e88dd077c29940b89a707265155 /ext/fg/js/frame.js
parentf3fe0994f52067d7c6d1886b02afd8f0a2a15099 (diff)
fix "url" not being set on kanji cards, add more fields
Diffstat (limited to 'ext/fg/js/frame.js')
-rw-r--r--ext/fg/js/frame.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js
index dba59000..df8ca894 100644
--- a/ext/fg/js/frame.js
+++ b/ext/fg/js/frame.js
@@ -49,7 +49,15 @@ class Frame {
$('.kanji-link').click(e => {
e.preventDefault();
- findKanji($(e.target).text()).then(kdefs => this.api_showKanjiDefs({options, definitions: kdefs}));
+ const character = $(e.target).text();
+ findKanji(character).then(kdefs => {
+ kdefs.forEach(kdef => {
+ kdef.url = definitions[0].url;
+ kdef.sentence = definitions[0].sentence;
+ });
+
+ this.api_showKanjiDefs({options, definitions: kdefs});
+ });
});
$('.action-play-audio').click(e => {