aboutsummaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-11 23:13:35 -0500
committerGitHub <noreply@github.com>2021-01-11 23:13:35 -0500
commit983e2c79361ad15ada6aae0d153fef9f1b867a93 (patch)
tree1b655b205cdc062f44248b0f0c9ef13d3ca85266 /ext/fg
parent5e87a490f78888717c58491959745431580bd64e (diff)
Refactor text scanner options context generation (#1225)
* Refactor how options context is created and updated * Udpate TextScanner/QueryParser to use getSearchContext instead of getOptionsContext
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/frontend.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 4ca7874a..e6f72689 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -54,7 +54,7 @@ class Frontend {
node: window,
ignoreElements: this._ignoreElements.bind(this),
ignorePoint: this._ignorePoint.bind(this),
- getOptionsContext: this._getOptionsContext.bind(this),
+ getSearchContext: this._getSearchContext.bind(this),
documentUtil: this._documentUtil,
searchTerms: true,
searchKanji: true
@@ -615,6 +615,10 @@ class Frontend {
}
async _getOptionsContext() {
+ return (await this._getSearchContext()).optionsContext;
+ }
+
+ async _getSearchContext() {
if (this._optionsContextOverride !== null) {
return this._optionsContextOverride;
}
@@ -629,6 +633,6 @@ class Frontend {
}
const depth = this._depth;
- return {depth, url};
+ return {optionsContext: {depth, url}};
}
}