Skip to content

Commit ac1fc66

Browse files
committed
consolidate variables in docsearch script
1 parent 77b17cb commit ac1fc66

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/js/vendor/docsearch.bundle.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
: algoliaOptions
2929
},
3030
})
31-
var eventEmitter = controller.autocomplete
32-
var autocomplete = eventEmitter.autocomplete
31+
var input = controller.input
32+
var autocomplete = input.autocomplete
3333
autocomplete.setVal()
34-
eventEmitter.on('autocomplete:selected', disableClose)
35-
eventEmitter.on('autocomplete:updated', resetScroll.bind(autocomplete.getWrapper().firstChild))
36-
controller.input.data('aaAutocomplete').dropdown._ensureVisible = ensureVisible
37-
if (filterInput) filterInput.addEventListener('change', toggleFilter.bind(controller.input))
34+
input.on('autocomplete:selected', disableClose)
35+
input.on('autocomplete:updated', resetScroll.bind(autocomplete.getWrapper().firstChild))
36+
input.data('aaAutocomplete').dropdown._ensureVisible = ensureVisible
37+
if (filterInput) filterInput.addEventListener('change', toggleFilter.bind(input))
3838
searchField.addEventListener('click', confineEvent)
3939
document.documentElement.addEventListener('click', resetSearch.bind(autocomplete))
40-
if (controller.input.attr('autofocus') != null) controller.input.focus()
40+
if (input.attr('autofocus') != null) input.focus()
4141
}
4242

4343
function appendStylesheet (href) {

0 commit comments

Comments
 (0)