From 99f5655e534421aca110bcf9bcdbf899b001f0dc Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 24 Jul 2020 14:54:54 -0400 Subject: Update DisplaySearch.setContent/clearContent to close popups (#682) --- ext/bg/js/search.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ext/bg') 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'); + } } -- cgit v1.2.3