summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-07 18:52:51 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-07 18:52:51 -0800
commitd770030688536403455132f24907725138528ef4 (patch)
tree8900123ba62262926d08cd5fd9b6e75ec3d304b4
parentfab7a03b6c345ccd9fec66adb08a45206557c306 (diff)
WIP
-rw-r--r--ext/bg/js/templates.js4
-rw-r--r--ext/fg/js/driver.js8
-rw-r--r--tmpl/kanji.html4
3 files changed, 11 insertions, 5 deletions
diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js
index f3d991de..5edf7be1 100644
--- a/ext/bg/js/templates.js
+++ b/ext/bg/js/templates.js
@@ -69,9 +69,9 @@ templates['kanji.html'] = template({"1":function(container,depth0,helpers,partia
},"11":function(container,depth0,helpers,partials,data) {
var stack1;
- return " <p>\n "
+ return " <p>"
+ container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? depth0.glossary : depth0)) != null ? stack1["0"] : stack1), depth0))
- + "\n </p>\n";
+ + "</p>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : {};
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index c0f0afe9..c0e328d5 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -160,6 +160,10 @@ class Driver {
this.popup.showNextTo(textSource.getRect());
this.popup.showTermDefs(definitions, this.options);
+ this.lastTextSource = textSource;
+ if (this.options.selectMatchedText) {
+ textSource.select();
+ }
return true;
}
@@ -180,6 +184,10 @@ class Driver {
this.popup.showNextTo(textSource.getRect());
this.popup.showKanjiDefs(definitions, this.options);
+ this.lastTextSource = textSource;
+ if (this.options.selectMatchedText) {
+ textSource.select();
+ }
return true;
}
diff --git a/tmpl/kanji.html b/tmpl/kanji.html
index a3f37cbf..eda8b8e4 100644
--- a/tmpl/kanji.html
+++ b/tmpl/kanji.html
@@ -42,9 +42,7 @@
{{/each}}
</ol>
{{else}}
- <p>
- {{glossary.[0]}}
- </p>
+ <p>{{glossary.[0]}}</p>
{{/if}}
</div>
</div>