summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-24 14:54:54 -0400
committerGitHub <noreply@github.com>2020-07-24 14:54:54 -0400
commit99f5655e534421aca110bcf9bcdbf899b001f0dc (patch)
tree1c67c5726228abf024765acf1af50fc206e38d20 /ext
parentd7aaab685ee23ebcd60b69211b02f6a66f57fa17 (diff)
Update DisplaySearch.setContent/clearContent to close popups (#682)
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/search.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index a3741da0..5be71555 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -158,7 +158,13 @@ class DisplaySearch extends Display {
async setContent(type, details) {
this._query.blur();
- await super.setContent(type, details);
+ this._closePopups();
+ return await super.setContent(type, details);
+ }
+
+ clearContent() {
+ this._closePopups();
+ return super.clearContent();
}
// Private
@@ -244,7 +250,6 @@ class DisplaySearch extends Display {
this.clearContent();
}
this._setTitleText(query);
- yomichan.trigger('closePopups');
} catch (e) {
this.onError(e);
}
@@ -413,4 +418,8 @@ class DisplaySearch extends Display {
await onOptionsUpdated();
}
+
+ _closePopups() {
+ yomichan.trigger('closePopups');
+ }
}