diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-05-01 15:54:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-01 15:54:31 -0400 |
commit | c514bbc4fbe39f611d7d9cfd3a48681bacbaf559 (patch) | |
tree | 275c792977b0c925fca67a324b036e1a81ba25dc /ext/js/display/search-display-controller.js | |
parent | 8bf6ff92f9e318554139d3f21f1dcdb98ce59036 (diff) |
Flags profile conditions (#1647)
* Generalize modifier keys
* Optimize bindings
* Add support for flags
* Add clipboard flag
* Update tests
* Add tests
Diffstat (limited to 'ext/js/display/search-display-controller.js')
-rw-r--r-- | ext/js/display/search-display-controller.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/js/display/search-display-controller.js b/ext/js/display/search-display-controller.js index f672909e..e60de796 100644 --- a/ext/js/display/search-display-controller.js +++ b/ext/js/display/search-display-controller.js @@ -179,12 +179,12 @@ class SearchDisplayController { e.preventDefault(); e.stopImmediatePropagation(); this._display.blurElement(e.currentTarget); - this._search(true, true, true); + this._search(true, true, true, null); } _onSearch(e) { e.preventDefault(); - this._search(true, true, true); + this._search(true, true, true, null); } _onCopy() { @@ -199,7 +199,7 @@ class SearchDisplayController { } this._queryInput.value = text; this._updateSearchHeight(true); - this._search(animate, false, autoSearchContent); + this._search(animate, false, autoSearchContent, ['clipboard']); } _onWanakanaEnableChange(e) { @@ -342,11 +342,15 @@ class SearchDisplayController { }); } - _search(animate, history, lookup) { + _search(animate, history, lookup, flags) { const query = this._queryInput.value; const depth = this._display.depth; const url = window.location.href; const documentTitle = document.title; + const optionsContext = {depth, url}; + if (flags !== null) { + optionsContext.flags = flags; + } const details = { focus: false, history, @@ -355,7 +359,7 @@ class SearchDisplayController { }, state: { focusEntry: 0, - optionsContext: {depth, url}, + optionsContext, url, sentence: {text: query, offset: 0}, documentTitle |