diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-03-13 23:23:08 +0200 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2020-03-21 22:13:07 +0200 |
commit | 962c2a381f3dace4d97fd0625504ec841e378354 (patch) | |
tree | 92ea4bee6a3a70f61965e98ca143b2a18cfcdad3 /ext/bg/js/search.js | |
parent | 647769f2baae338f201690f21c4bf8983bcb10b0 (diff) |
apply all options on profile change
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r-- | ext/bg/js/search.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index e2bdff73..8b8ee55e 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -247,15 +247,12 @@ class DisplaySearch extends Display { } onWanakanaEnableChange(e) { - const {queryParams: {query=''}} = parseUrl(window.location.href); const enableWanakana = e.target.checked; if (enableWanakana) { window.wanakana.bind(this.query); } else { window.wanakana.unbind(this.query); } - this.setQuery(query); - this.onSearchQueryUpdated(this.query.value, false); apiOptionsSet({general: {enableWanakana}}, this.getOptionsContext()); } @@ -278,19 +275,20 @@ class DisplaySearch extends Display { } } - async updateOptions(options) { - await super.updateOptions(options); + async updateOptions() { + await super.updateOptions(); this.queryParser.setOptions(this.options); + const query = this.query.value; + if (query) { + this.setQuery(query); + this.onSearchQueryUpdated(query, false); + } } isWanakanaEnabled() { return this.wanakanaEnable !== null && this.wanakanaEnable.checked; } - getOptionsContext() { - return this.optionsContext; - } - setQuery(query) { const interpretedQuery = this.isWanakanaEnabled() ? window.wanakana.toKana(query) : query; this.query.value = interpretedQuery; |