summaryrefslogtreecommitdiff
path: root/ext/js/display
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-28 14:18:18 -0500
committerGitHub <noreply@github.com>2021-02-28 14:18:18 -0500
commit4806414f957ca324fad7d152ef04e34602a7bdbd (patch)
tree77e28414d19a5a417a208ea13e1a1d492c2404a3 /ext/js/display
parent6f76645f4cf0005ddb1022406fdf259a5117ce26 (diff)
Text source element scanning improvements (#1464)
* Add api.textHasJapaneseCharacters * Add support for empty query * Add support for showing the query parser for TextSourceElement with content that does not start with Japanese text
Diffstat (limited to 'ext/js/display')
-rw-r--r--ext/js/display/display.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index ad9a25b4..8b521d21 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -543,7 +543,7 @@ class Display extends EventDispatcher {
case 'kanji':
{
let query = urlSearchParams.get('query');
- if (!query) { break; }
+ if (query === null) { break; }
this._query = query;
clear = false;
@@ -882,7 +882,7 @@ class Display extends EventDispatcher {
let {definitions} = content;
if (!Array.isArray(definitions)) {
- definitions = lookup ? await this._findDefinitions(isTerms, query, wildcardsEnabled, optionsContext) : [];
+ definitions = lookup && query.length > 0 ? await this._findDefinitions(isTerms, query, wildcardsEnabled, optionsContext) : [];
if (this._setContentToken !== token) { return; }
content.definitions = definitions;
changeHistory = true;