aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-09-11 20:41:41 -0700
committerAlex Yatskov <alex@foosoft.net>2016-09-11 20:41:41 -0700
commitfa446f540a3a93d51c457da661d61976bdd5cbdf (patch)
treed5aa6ba6fed72ccd0cde7a3e0a46c3c4d9d89bf1 /ext/fg/js/client.js
parentf653195aed4fe1ce12b771cb1e5de06d9e6f0253 (diff)
WIP
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 266e4b5a..9a0ad25a 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -97,6 +97,7 @@ class Client {
this.pendingLookup = true;
bgFindTerm(textSource.text()).then(({definitions, length}) => {
if (length === 0) {
+ this.pendingLookup = false;
this.hidePopup();
} else {
textSource.setEndOffset(length);
@@ -108,8 +109,9 @@ class Client {
});
const sequence = ++this.sequence;
- return bgRenderText({definitions, sequence, root: this.fgRoot, options: this.options}, 'term-list.html').then((content) => {
+ return bgRenderText({definitions, sequence, root: this.fgRoot, options: this.options}, 'term-list.html').then(content => {
this.definitions = definitions;
+ this.pendingLookup = false;
this.showPopup(textSource, content);
return bgCanAddDefinitions(definitions, ['term_kanji', 'term_kana']);
}).then(states => {
@@ -118,7 +120,7 @@ class Client {
}
});
}
- }).then(() => this.pendingLookup = false);
+ });
}
showPopup(textSource, content) {