summaryrefslogtreecommitdiff
path: root/ext/bg/js/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r--ext/bg/js/search.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index a4103ef2..f5c641a8 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -220,12 +220,12 @@ class DisplaySearch extends Display {
this.updateSearchButton();
if (valid) {
const {definitions} = await apiTermsFind(query, details, this.optionsContext);
- this.setContentTerms(definitions, {
+ this.setContent('terms', {definitions, context: {
focus: false,
disableHistory: true,
sentence: {text: query, offset: 0},
url: window.location.href
- });
+ }});
} else {
this.container.textContent = '';
}
@@ -236,6 +236,11 @@ class DisplaySearch extends Display {
}
}
+ async updateOptions(options) {
+ await super.updateOptions(options);
+ this.queryParser.setOptions(this.options);
+ }
+
initClipboardMonitor() {
// ignore copy from search page
window.addEventListener('copy', () => {
@@ -260,7 +265,7 @@ class DisplaySearch extends Display {
text !== this.clipboardPreviousText
) {
this.clipboardPreviousText = text;
- if (jpIsJapaneseText(text)) {
+ if (jpIsStringPartiallyJapanese(text)) {
this.setQuery(this.isWanakanaEnabled() ? window.wanakana.toKana(text) : text);
window.history.pushState(null, '', `${window.location.pathname}?query=${encodeURIComponent(text)}`);
this.onSearchQueryUpdated(this.query.value, true);