summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2019-12-06 14:56:36 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2019-12-06 14:56:36 +0200
commita5a6351cceacde6f440d28ff7f9afa7c6c1ff251 (patch)
tree48f7d51b5144b5c401baef1e10a2359d6fa65fed /ext/bg
parentb418760a521033dd0939194ab8cfef3dbeac29fc (diff)
revert search page title on empty query
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/search.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index fe48773f..b2bc172f 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -224,10 +224,10 @@ class DisplaySearch extends Display {
sentence: {text: query, offset: 0},
url: window.location.href
});
- this.setTitleText(query);
} else {
this.container.textContent = '';
}
+ this.setTitleText(query);
window.parent.postMessage('popupClose', '*');
} catch (e) {
this.onError(e);
@@ -362,7 +362,12 @@ class DisplaySearch extends Display {
if (text.length > 1000) {
text = text.slice(0, 1000) + '...';
}
- document.title = `${text} - Yomichan Search`;
+
+ if (text.length === 0) {
+ document.title = 'Yomichan Search';
+ } else {
+ document.title = `${text} - Yomichan Search`;
+ }
}
static getSearchQueryFromLocation(url) {