summaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js29
1 files changed, 18 insertions, 11 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 639c2673..1b629dec 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -164,16 +164,7 @@ class Display {
onSourceTerm(e) {
e.preventDefault();
-
- if (this.context && this.context.source) {
- const context = {
- url: this.context.source.url,
- sentence: this.context.source.sentence,
- index: this.context.source.index
- };
-
- this.showTermDefs(this.context.source.definitions, this.options, context);
- }
+ this.sourceBack();
}
onKanjiLookup(e) {
@@ -247,6 +238,10 @@ class Display {
this.entryScroll(this.index + 1, true);
},
+ 66: /* b */ () => {
+ this.sourceBack();
+ },
+
69: /* e */ () => {
noteTryAdd('term-kanji');
},
@@ -260,7 +255,7 @@ class Display {
},
80: /* p */ () => {
- if (Display.adderButtonFind(this.index, 'kanji').length === 0) {
+ if ($('.entry').eq(this.index).data('type') === 'term') {
this.audioPlay(this.definitions[this.index]);
}
}
@@ -273,6 +268,18 @@ class Display {
}
}
+ sourceBack() {
+ if (this.context && this.context.source) {
+ const context = {
+ url: this.context.source.url,
+ sentence: this.context.source.sentence,
+ index: this.context.source.index
+ };
+
+ this.showTermDefs(this.context.source.definitions, this.options, context);
+ }
+ }
+
noteAdd(definition, mode) {
this.spinner.show();
return this.definitionAdd(definition, mode).then(success => {