diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-04 19:27:54 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-04 19:27:54 -0800 |
commit | 158818713a59509344b0916e6dcfb44cb5042dbd (patch) | |
tree | a65103203aaf7f974cd10c6fdfda6c04892a4743 | |
parent | db7e80dabfbaeec09c7cd30b4f36b3d68c6e52b6 (diff) |
fixes
-rw-r--r-- | ext/mixed/js/display.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index f4ce4f67..860a3e43 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -68,7 +68,14 @@ class Display { this.container.html(content); $('.action-add-note').click(this.onActionAddNote.bind(this)); $('.action-play-audio').click(this.onActionPlayAudio.bind(this)); - $('.kanji-link').click(e => this.onKanjiSearch(e, options)); + $('.kanji-link').click(e => { + e.preventDefault(); + const character = $(e.target).text(); + this.kanjiFind(character).then(definitions => { + this.showKanjiDefs(definitions, options, context); + }).catch(this.handleError.bind(this)); + }); + return this.adderButtonsUpdate(['term_kanji', 'term_kana'], sequence); }).catch(this.handleError.bind(this)); } @@ -122,14 +129,6 @@ class Display { }); } - onKanjiSearch(e, options) { - e.preventDefault(); - const character = $(e.target).text(); - this.kanjiFind(character).then(definitions => { - this.showKanjiDefs(definitions, options, context); - }).catch(this.handleError.bind(this)); - } - onActionPlayAudio(e) { e.preventDefault(); const index = $(e.currentTarget).data('index'); |