diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-16 21:53:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-16 21:53:52 -0500 |
commit | 30ce81b36cacfbab173098b9eceb85ccf9c9870f (patch) | |
tree | b1e26691ff7350d46b47c7eaf35f5c34c85fe184 /ext/mixed/js | |
parent | 0cbbe4869421d1796b4606db8263d33d7581679d (diff) |
Update TextScanner.search to return the event details object (#1257)
Diffstat (limited to 'ext/mixed/js')
-rw-r--r-- | ext/mixed/js/text-scanner.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index 98d87341..411b1b20 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -309,7 +309,7 @@ class TextScanner extends EventDispatcher { try { if (this._textSourceCurrent !== null && this._textSourceCurrent.hasSameStart(textSource)) { - return; + return null; } ({optionsContext, detail} = await this._getSearchContext()); @@ -327,9 +327,9 @@ class TextScanner extends EventDispatcher { error = e; } - if (!searched) { return; } + if (!searched) { return null; } - this.trigger('searched', { + const results = { textScanner: this, type, definitions, @@ -339,7 +339,9 @@ class TextScanner extends EventDispatcher { optionsContext, detail, error - }); + }; + this.trigger('searched', results); + return results; } _onMouseOver(e) { |