From 158818713a59509344b0916e6dcfb44cb5042dbd Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 4 Mar 2017 19:27:54 -0800 Subject: fixes --- ext/mixed/js/display.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ext') 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'); -- cgit v1.2.3