aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/driver.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-09 09:30:56 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-09 09:30:56 -0800
commit89070c609645455ac307bd0de918f2b76726dd3a (patch)
tree266b2586a03968404ef95ac80d284aa5aa0026a7 /ext/fg/js/driver.js
parent60e23ab42c86fbc74a6e16d6fd29fcc6761bfb36 (diff)
cleanup
Diffstat (limited to 'ext/fg/js/driver.js')
-rw-r--r--ext/fg/js/driver.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index 12003d55..ef7db481 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -146,13 +146,7 @@ class Driver {
searchTerms(textSource) {
textSource.setEndOffset(this.options.scanLength);
- let findFunc = findTerm;
- let showFunc = this.popup.showTermDefs.bind(this.popup);
- if (this.options.groupTermResults) {
- findFunc = findTermGrouped;
- showFunc = this.popup.showTermGroupedDefs.bind(this.popup);
- }
-
+ const findFunc = this.options.groupTermResults ? findTermGrouped : findTerm;
return findFunc(textSource.text()).then(({definitions, length}) => {
if (definitions.length === 0) {
return false;
@@ -166,7 +160,7 @@ class Driver {
});
this.popup.showNextTo(textSource.getRect());
- showFunc(definitions, this.options);
+ this.popup.showTermDefs(definitions, this.options);
this.lastTextSource = textSource;
if (this.options.selectMatchedText) {
textSource.select();