diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-17 11:43:05 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-17 11:43:05 -0500 | 
| commit | be590004fee5bbbbaefa8a11ddecdb4fca6f7da7 (patch) | |
| tree | 40ff739237817035f3836667eba1068233ad0762 /ext/bg/js | |
| parent | 5d9d96996e1b80ecca94023e20476e5e2f85bbff (diff) | |
Text scanner improvements (#1261)
* Add support for allowing TextScanner.search to force focus
* Simplify query parser searched event forwarding
* Defer fallback creation
* Simplify event listeners
* Change type to pointerType
* Change cause to eventType
* Change empty to passive; make .search function passive
* Remove unused input index
Diffstat (limited to 'ext/bg/js')
| -rw-r--r-- | ext/bg/js/query-parser.js | 17 | 
1 files changed, 5 insertions, 12 deletions
| diff --git a/ext/bg/js/query-parser.js b/ext/bg/js/query-parser.js index fced2bda..ea215582 100644 --- a/ext/bg/js/query-parser.js +++ b/ext/bg/js/query-parser.js @@ -82,22 +82,15 @@ class QueryParser extends EventDispatcher {      // Private -    _onSearched({type, definitions, sentence, inputInfo, textSource, optionsContext, detail, error}) { +    _onSearched(e) { +        const {error} = e;          if (error !== null) {              yomichan.logError(error);              return;          } -        if (type === null) { return; } - -        this.trigger('searched', { -            type, -            definitions, -            sentence, -            inputInfo, -            textSource, -            optionsContext, -            detail -        }); +        if (e.type === null) { return; } + +        this.trigger('searched', e);      }      _onParserChange(e) { |