aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mixed/js/display.js17
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');