Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-11-09 21:47:02 +0300
committerGitHub <noreply@github.com>2020-11-09 21:47:02 +0300
commit1d86fcee7b81bbae0b53b24e85847b3adfc3c57c (patch)
tree13f714e55ac05c7aeb637d14cf198a138c81f058
parente347441f8834636bb7bf10c8078689ccc4308756 (diff)
search.js: check for `search-input` element early (#32100)
-rw-r--r--site/assets/js/search.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/site/assets/js/search.js b/site/assets/js/search.js
index 2cf4c87878..14c138fa5b 100644
--- a/site/assets/js/search.js
+++ b/site/assets/js/search.js
@@ -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) {