summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-18 10:10:49 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-18 10:10:49 -0700
commite782a4343251bb76c3b7d0bb4b788d7a6ac7756e (patch)
treefe61432c836013f78e9f88fcd5d412ec4667a774
parentaaff51da852e0bae17e06b0ba0796723e26741d4 (diff)
fix kanji back button on search page1.1.6
-rw-r--r--ext/manifest.json2
-rw-r--r--ext/mixed/js/display.js19
2 files changed, 10 insertions, 11 deletions
diff --git a/ext/manifest.json b/ext/manifest.json
index 8a3f94b2..30f33975 100644
--- a/ext/manifest.json
+++ b/ext/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Yomichan",
- "version": "1.1.5",
+ "version": "1.1.6",
"description": "Japanese dictionary with Anki integration",
"icons": {"16": "mixed/img/icon16.png", "48": "mixed/img/icon48.png", "128": "mixed/img/icon128.png"},
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 6ce84626..d90cf897 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -60,8 +60,8 @@ class Display {
if (context) {
for (const definition of definitions) {
- definition.sentence = context.sentence;
- definition.url = context.url;
+ definition.sentence = context.sentence || '';
+ definition.url = context.url || '';
}
}
@@ -86,12 +86,11 @@ class Display {
e.preventDefault();
const link = $(e.target);
- if (context) {
- context.source = {
- definitions,
- index: Display.entryIndexFind(link)
- };
- }
+ context = context || {};
+ context.source = {
+ definitions,
+ index: Display.entryIndexFind(link)
+ };
this.kanjiFind(link.text()).then(kanjiDefs => {
this.showKanjiDefs(kanjiDefs, options, context);
@@ -115,8 +114,8 @@ class Display {
if (context) {
for (const definition of definitions) {
- definition.sentence = context.sentence;
- definition.url = context.url;
+ definition.sentence = context.sentence || '';
+ definition.url = context.url || '';
}
}