summaryrefslogtreecommitdiff
path: root/ext/bg/js/display-window.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-08-13 16:11:51 -0700
committerAlex Yatskov <alex@foosoft.net>2017-08-13 16:11:51 -0700
commitaac2a58b5f821c6f90c95bb19f3b0a755d5e1739 (patch)
treed6c4b503f6a8daeabfa15f757866ef18ef4c5c64 /ext/bg/js/display-window.js
parent7fbe2ddaf33bad05fb26aec759806e0f6ae250d2 (diff)
wip
Diffstat (limited to 'ext/bg/js/display-window.js')
-rw-r--r--ext/bg/js/display-window.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/display-window.js b/ext/bg/js/display-window.js
index 52c0cafa..cbb96681 100644
--- a/ext/bg/js/display-window.js
+++ b/ext/bg/js/display-window.js
@@ -17,26 +17,26 @@
*/
-window.displayWindow = new class extends Display {
+window.yomichan_window = new class extends Display {
constructor() {
super($('#spinner'), $('#content'));
this.search = $('#search').click(this.onSearch.bind(this));
- this.query = $('#query').on('input', this.inputSearch.bind(this));
+ this.query = $('#query').on('input', this.onSearchInput.bind(this));
this.intro = $('#intro');
window.wanakana.bind(this.query.get(0));
}
- handleError(error) {
+ onError(error) {
window.alert(`Error: ${error}`);
}
- clearSearch() {
+ onSearchClear() {
this.query.focus().select();
}
- inputSearch() {
+ onSearchInput() {
this.search.prop('disabled', this.query.val().length === 0);
}
@@ -46,9 +46,9 @@ window.displayWindow = new class extends Display {
try {
this.intro.slideUp();
const {length, definitions} = await apiTermsFind(this.query.val());
- super.showTermDefs(definitions, await apiOptionsGet());
+ super.termsShow(definitions, await apiOptionsGet());
} catch (e) {
- this.handleError(e);
+ this.onError(e);
}
}
};