aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
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/mixed/js/display.js
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/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index ea30030c..509683a6 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -82,7 +82,7 @@ class Display extends EventDispatcher {
this._queryParserVisibleOverride = null;
this._queryParserContainer = document.querySelector('#query-parser-container');
this._queryParser = new QueryParser({
- getOptionsContext: this.getOptionsContext.bind(this),
+ getSearchContext: this._getSearchContext.bind(this),
documentUtil: this._documentUtil
});
this._mode = null;
@@ -1764,7 +1764,7 @@ class Display extends EventDispatcher {
if (this._definitionTextScanner === null) {
this._definitionTextScanner = new TextScanner({
node: window,
- getOptionsContext: this.getOptionsContext.bind(this),
+ getSearchContext: this._getSearchContext.bind(this),
documentUtil: this._documentUtil,
searchTerms: true,
searchKanji: false,
@@ -1861,6 +1861,10 @@ class Display extends EventDispatcher {
}
}
+ _getSearchContext() {
+ return {optionsContext: this.getOptionsContext()};
+ }
+
_startFrameResize(e) {
if (this._frameResizeToken !== null) { return; }