From 8cb041e3bcc02bb0b81541a12c0e4880eb158264 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sun, 2 Sep 2018 19:33:55 -0600 Subject: [PATCH] slighly optimize docsearch code --- src/js/vendor/docsearch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/vendor/docsearch.js b/src/js/vendor/docsearch.js index 1c17d7a..2106c53 100644 --- a/src/js/vendor/docsearch.js +++ b/src/js/vendor/docsearch.js @@ -5,7 +5,7 @@ var style = document.createElement('style') style.innerText = '@import "' + config.stylesheet + '"' document.head.appendChild(style) - var docsearchInstance = docsearch({ + var ds = docsearch({ appId: config.appId, apiKey: config.apiKey, indexName: config.indexName, @@ -15,8 +15,8 @@ }) document.querySelector('button.search').addEventListener('click', function (e) { if (document.querySelector('.navbar-start').classList.toggle('reveal-search-input')) { - docsearchInstance.autocomplete.autocomplete.setVal('') - docsearchInstance.input.focus() + ds.autocomplete.autocomplete.setVal('') + ds.input.focus() } }) }, 1000)