Unverified Commit 1d86fcee authored by XhmikosR's avatar XhmikosR Committed by GitHub
Browse files

search.js: check for `search-input` element early (#32100)

parent e347441f
Showing with 3 additions and 2 deletions
+3 -2
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
(function () { (function () {
'use strict' 'use strict'
if (!window.docsearch) { var inputElement = document.getElementById('search-input')
if (!window.docsearch || !inputElement) {
return return
} }
var inputElement = document.getElementById('search-input')
var siteDocsVersion = inputElement.getAttribute('data-docs-version') var siteDocsVersion = inputElement.getAttribute('data-docs-version')
document.addEventListener('keydown', function (event) { document.addEventListener('keydown', function (event) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment