Tutti: Check if algoliaIndex is defined

This commit is contained in:
2016-09-22 18:49:19 +02:00
parent 30215bf87c
commit dfe398458b
2 changed files with 5 additions and 3 deletions

View File

@@ -4,10 +4,13 @@
*/
$(document).ready(function() {
if (typeof algoliaIndex === 'undefined') return;
var searchInput = $('#cloud-search');
var tu = searchInput.typeahead({hint: true}, {
source: index.ttAdapter(),
source: algoliaIndex.ttAdapter(),
displayKey: 'name',
limit: 10,
minLength: 0,
@@ -47,7 +50,6 @@ $(document).ready(function() {
}
});
$('.search-site-result.advanced, .search-icon').on('click', function(e){
e.stopPropagation();
e.preventDefault();