diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-12 18:04:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 18:04:26 -0500 |
commit | b7c9fa105764eb2cd5befea86c98fe49f5763a1d (patch) | |
tree | 59e9dec9f3b1b08b8e252206a32957385c3907ca /ext/bg/js/search.js | |
parent | 983e2c79361ad15ada6aae0d153fef9f1b867a93 (diff) |
Refactor note document title (#1227)
* Pass url into setContent
* Update where url is checked from
* Add documentTitle to state information
* Update how _getNoteContext gets the document title
* Update how url is fetched for options context
* Pass document title in to 'searched' event
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r-- | ext/bg/js/search.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 1417bdb5..991acf2b 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -349,6 +349,9 @@ class DisplaySearch extends Display { _search(animate, history) { const query = this._queryInput.value; + const depth = this.depth; + const url = window.location.href; + const documentTitle = document.title; const details = { focus: false, history, @@ -357,8 +360,10 @@ class DisplaySearch extends Display { }, state: { focusEntry: 0, + optionsContext: {depth, url}, + url, sentence: {text: query, offset: 0}, - url: window.location.href + documentTitle }, content: { definitions: null, |