Update DisplaySearch.setContent/clearContent to close popups (#682)

This commit is contained in:
toasted-nutbread 2020-07-24 14:54:54 -04:00 committed by GitHub
parent d7aaab685e
commit 99f5655e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,13 @@ class DisplaySearch extends Display {
async setContent(type, details) { async setContent(type, details) {
this._query.blur(); this._query.blur();
await super.setContent(type, details); this._closePopups();
return await super.setContent(type, details);
}
clearContent() {
this._closePopups();
return super.clearContent();
} }
// Private // Private
@ -244,7 +250,6 @@ class DisplaySearch extends Display {
this.clearContent(); this.clearContent();
} }
this._setTitleText(query); this._setTitleText(query);
yomichan.trigger('closePopups');
} catch (e) { } catch (e) {
this.onError(e); this.onError(e);
} }
@ -413,4 +418,8 @@ class DisplaySearch extends Display {
await onOptionsUpdated(); await onOptionsUpdated();
} }
_closePopups() {
yomichan.trigger('closePopups');
}
} }