mirror of https://github.com/twbs/bootstrap.git
search.js: check for `search-input` element early (#32100)
This commit is contained in:
parent
e347441f88
commit
1d86fcee7b
|
@ -5,11 +5,12 @@
|
|||
(function () {
|
||||
'use strict'
|
||||
|
||||
if (!window.docsearch) {
|
||||
var inputElement = document.getElementById('search-input')
|
||||
|
||||
if (!window.docsearch || !inputElement) {
|
||||
return
|
||||
}
|
||||
|
||||
var inputElement = document.getElementById('search-input')
|
||||
var siteDocsVersion = inputElement.getAttribute('data-docs-version')
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
|
|
Loading…
Reference in New Issue