Skip to content

Commit 1906850

Browse files
committed
rename disableClose function in search script to onSuggestionSelected
1 parent 1c75a18 commit 1906850

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
@@ -41,7 +41,7 @@
4141
typeahead.setVal() // clear value on page reload
4242
input.on('autocomplete:closed', clearSearch.bind(typeahead))
4343
input.on('autocomplete:cursorchanged autocomplete:cursorremoved', saveSearchState.bind(typeahead))
44-
input.on('autocomplete:selected', disableClose)
44+
input.on('autocomplete:selected', onSuggestionSelected)
4545
input.on('autocomplete:updated', onResultsUpdated.bind(typeahead))
4646
dropdown._ensureVisible = ensureVisible
4747
menu.off('mousedown.aa')
@@ -93,12 +93,6 @@
9393
e.stopPropagation()
9494
}
9595

96-
function disableClose (e) {
97-
e.isDefaultPrevented = function () {
98-
return true
99-
}
100-
}
101-
10296
function ensureVisible (el) {
10397
var container = this.datasets[0].$el[0]
10498
if (container.scrollHeight === container.offsetHeight) return
@@ -158,6 +152,12 @@
158152
}, 0)
159153
}
160154

155+
function onSuggestionSelected (e) {
156+
e.isDefaultPrevented = function () {
157+
return true
158+
}
159+
}
160+
161161
function clearSearch () {
162162
this.setVal()
163163
}

0 commit comments

Comments
 (0)