summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-24 11:54:08 -0500
committerGitHub <noreply@github.com>2020-11-24 11:54:08 -0500
commitde299c64ae0d32f316d1679b79dd1ad72e1c0ed9 (patch)
treee33bca0a10693a6d8dcdad3c516da26d26b6250f /ext/bg
parent068b1eef71ed1167e7e39effa00cda7deb9251f2 (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')
-rw-r--r--ext/bg/js/search.js14
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
},