summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/query-parser.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/ext/bg/js/query-parser.js b/ext/bg/js/query-parser.js
index a7c00829..fced2bda 100644
--- a/ext/bg/js/query-parser.js
+++ b/ext/bg/js/query-parser.js
@@ -21,9 +21,9 @@
*/
class QueryParser extends EventDispatcher {
- constructor({getOptionsContext, documentUtil}) {
+ constructor({getSearchContext, documentUtil}) {
super();
- this._getOptionsContext = getOptionsContext;
+ this._getSearchContext = getSearchContext;
this._documentUtil = documentUtil;
this._text = '';
this._setTextToken = null;
@@ -34,7 +34,7 @@ class QueryParser extends EventDispatcher {
this._queryParserModeSelect = document.querySelector('#query-parser-mode-select');
this._textScanner = new TextScanner({
node: this._queryParser,
- getOptionsContext,
+ getSearchContext,
documentUtil,
searchTerms: true,
searchKanji: false,
@@ -82,7 +82,7 @@ class QueryParser extends EventDispatcher {
// Private
- _onSearched({type, definitions, sentence, inputInfo, textSource, optionsContext, error}) {
+ _onSearched({type, definitions, sentence, inputInfo, textSource, optionsContext, detail, error}) {
if (error !== null) {
yomichan.logError(error);
return;
@@ -95,7 +95,8 @@ class QueryParser extends EventDispatcher {
sentence,
inputInfo,
textSource,
- optionsContext
+ optionsContext,
+ detail
});
}
@@ -104,6 +105,10 @@ class QueryParser extends EventDispatcher {
this._setSelectedParser(value);
}
+ _getOptionsContext() {
+ return this._getSearchContext().optionsContext;
+ }
+
_refreshSelectedParser() {
if (this._parseResults.length > 0 && !this._getParseResult()) {
const value = this._parseResults[0].id;