Skip to content

Commit

Permalink
slighly optimize docsearch code
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Sep 3, 2018
1 parent 94831c0 commit 8cb041e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/vendor/docsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var style = document.createElement('style')
style.innerText = '@import "' + config.stylesheet + '"'
document.head.appendChild(style)
var docsearchInstance = docsearch({
var ds = docsearch({
appId: config.appId,
apiKey: config.apiKey,
indexName: config.indexName,
Expand All @@ -15,8 +15,8 @@
})
document.querySelector('button.search').addEventListener('click', function (e) {
if (document.querySelector('.navbar-start').classList.toggle('reveal-search-input')) {
docsearchInstance.autocomplete.autocomplete.setVal('')
docsearchInstance.input.focus()
ds.autocomplete.autocomplete.setVal('')
ds.input.focus()
}
})
}, 1000)
Expand Down

0 comments on commit 8cb041e

Please sign in to comment.