diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-08 12:34:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-08 12:34:23 -0500 |
commit | 8cf10d685d52d5ae75d65c4aea4adcb6d101e9a4 (patch) | |
tree | 3a1874942370917e328976854c5a5c7352d9e085 /ext/mixed/js/display.js | |
parent | db9ec4c4495404ad3ebc9ce56866c3631cedf8dc (diff) |
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
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r-- | ext/mixed/js/display.js | 11 |
1 files changed, 7 insertions, 4 deletions
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; |