From be590004fee5bbbbaefa8a11ddecdb4fca6f7da7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 17 Jan 2021 11:43:05 -0500 Subject: 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 --- ext/bg/js/query-parser.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'ext/bg') 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) { -- cgit v1.2.3