diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-24 11:54:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 11:54:08 -0500 |
commit | de299c64ae0d32f316d1679b79dd1ad72e1c0ed9 (patch) | |
tree | e33bca0a10693a6d8dcdad3c516da26d26b6250f /ext/bg/js/search.js | |
parent | 068b1eef71ed1167e7e39effa00cda7deb9251f2 (diff) |
Display updates (#1057)
* Fix history assignment on the search page
* Use clear instead of assigned
* Simplify definitions assignment
* Organize
* Fix query not being cleared
* Fix media loading
* Fix potential issue with options not being assigned
* Catch error when frameId is null, causing infinite loop
* Fix frontend construction parameters
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r-- | ext/bg/js/search.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 476370bf..effa31bc 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -143,7 +143,7 @@ class DisplaySearch extends Display { await this.updateOptions(); const query = this._queryInput.value; if (query) { - this._search(false); + this._search(false, false); } } @@ -153,7 +153,7 @@ class DisplaySearch extends Display { switch (type) { case 'terms': case 'kanji': - animate = content.animate; + animate = !!content.animate; valid = content.definitions.length > 0; this.blurElement(this._queryInput); break; @@ -182,12 +182,12 @@ class DisplaySearch extends Display { e.preventDefault(); e.stopImmediatePropagation(); this.blurElement(e.currentTarget); - this._search(true); + this._search(true, true); } _onSearch(e) { e.preventDefault(); - this._search(true); + this._search(true, true); } _onCopy() { @@ -197,7 +197,7 @@ class DisplaySearch extends Display { _onExternalSearchUpdate({text, animate=true}) { this._queryInput.value = text; - this._search(animate); + this._search(animate, false); } _onWanakanaEnableChange(e) { @@ -342,11 +342,11 @@ class DisplaySearch extends Display { }); } - _search(animate) { + _search(animate, history) { const query = this._queryInput.value; const details = { focus: false, - history: false, + history, params: { query }, |