aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/query-parser.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-19 20:09:37 -0400
committerGitHub <noreply@github.com>2021-05-19 20:09:37 -0400
commit6184bcb812686f5498ee982ae89da88792b9a880 (patch)
treeb64fd9b45fe8909c3c5e553af701e6ae18fc0170 /ext/js/display/query-parser.js
parenteddd0288643f08d2a2c85f73575bc7ee1c157539 (diff)
Selection clear improvements (#1690)
* Update selection clear process * Clean up old clearSelection API * Update clear order * Add clear event handling
Diffstat (limited to 'ext/js/display/query-parser.js')
-rw-r--r--ext/js/display/query-parser.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js
index 8c5ce331..39b09646 100644
--- a/ext/js/display/query-parser.js
+++ b/ext/js/display/query-parser.js
@@ -47,6 +47,7 @@ class QueryParser extends EventDispatcher {
prepare() {
this._textScanner.prepare();
+ this._textScanner.on('clear', this._onTextScannerClear.bind(this));
this._textScanner.on('searched', this._onSearched.bind(this));
this._queryParserModeSelect.addEventListener('change', this._onParserChange.bind(this), false);
}
@@ -86,6 +87,10 @@ class QueryParser extends EventDispatcher {
// Private
+ _onTextScannerClear() {
+ this._textScanner.clearSelection();
+ }
+
_onSearched(e) {
const {error} = e;
if (error !== null) {