Update TextScanner.search to return the event details object (#1257)
This commit is contained in:
parent
0cbbe48694
commit
30ce81b36c
@ -309,7 +309,7 @@ class TextScanner extends EventDispatcher {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (this._textSourceCurrent !== null && this._textSourceCurrent.hasSameStart(textSource)) {
|
if (this._textSourceCurrent !== null && this._textSourceCurrent.hasSameStart(textSource)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
({optionsContext, detail} = await this._getSearchContext());
|
({optionsContext, detail} = await this._getSearchContext());
|
||||||
@ -327,9 +327,9 @@ class TextScanner extends EventDispatcher {
|
|||||||
error = e;
|
error = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!searched) { return; }
|
if (!searched) { return null; }
|
||||||
|
|
||||||
this.trigger('searched', {
|
const results = {
|
||||||
textScanner: this,
|
textScanner: this,
|
||||||
type,
|
type,
|
||||||
definitions,
|
definitions,
|
||||||
@ -339,7 +339,9 @@ class TextScanner extends EventDispatcher {
|
|||||||
optionsContext,
|
optionsContext,
|
||||||
detail,
|
detail,
|
||||||
error
|
error
|
||||||
});
|
};
|
||||||
|
this.trigger('searched', results);
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onMouseOver(e) {
|
_onMouseOver(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user