From 8cf10d685d52d5ae75d65c4aea4adcb6d101e9a4 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 8 Nov 2020 12:34:23 -0500 Subject: Search and display style updates (#1005) * Use same selectors * Use consistent stylesheet declaration * Fix query parser not being cleared * Set property upon load * Don't focus for Enter key press * Update search page styles * Update indent and nodes * Support dark style * Add missing var --- ext/mixed/js/display.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ext/mixed/js') diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 0d724aa0..38a441bd 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -32,10 +32,10 @@ */ class Display extends EventDispatcher { - constructor(spinner, container) { + constructor() { super(); - this._spinner = spinner; - this._container = container; + this._spinner = document.querySelector('#spinner'); + this._container = document.querySelector('#definitions'); this._definitions = []; this._optionsContext = {depth: 0, url: window.location.href}; this._options = null; @@ -804,7 +804,10 @@ class Display extends EventDispatcher { async _setContentTermsOrKanji(token, isTerms, urlSearchParams, eventArgs) { let source = urlSearchParams.get('query'); - if (!source) { return false; } + if (!source) { + this._setQueryParserText(''); + return false; + } let {state, content} = this._history; let changeHistory = false; -- cgit v1.2.3