diff --git a/src/scripts/tutti/4_search.js b/src/scripts/tutti/4_search.js index cd72c43a..604d3cd0 100644 --- a/src/scripts/tutti/4_search.js +++ b/src/scripts/tutti/4_search.js @@ -157,7 +157,7 @@ $(document).ready(function() { minLength: 0, templates: { suggestion: function(hit) { - console.log('hit!'); + var hitMedia = (hit.media ? ' · '+hit.media+'' : ''); var hitFree = (hit.is_free ? '
free
' : ''); var hitPicture; @@ -174,21 +174,27 @@ $(document).ready(function() { .attr('title', hit.name) .text(hit.name); - return '' + - '' + - '
' + - '
' + - hitPicture + - hitFree + - '
' + - $searchHitName.html() + - '
' + - $span.html() + ' · ' + - '' + hit.node_type + '' + - hitMedia + - '
' + - '
'+ - '
'; + return $('', { + href: '/nodes/'+ hit.objectID + '/redir', + class: "search-site-result", + id: hit.objectID + }).append( + '
' + + '
' + + hitPicture + + hitFree + + '
' + + $searchHitName.html() + + '
' + + $span.html() + ' · ' + + $('', { + class: "node_type", + text: hit.node_type + }) + + hitMedia + + '
' + + '
' + ) } } }); @@ -227,7 +233,11 @@ $(document).ready(function() { searchInput.bind('typeahead:render', function(event, suggestions, async, dataset) { if( suggestions != undefined && $('.tt-all-results').length <= 0){ $('.tt-dataset').append( - '
' + + $("", { + id: "search-advanced", + href: '/search?q='+ $("#cloud-search").val() + '&page=1', + class: "search-site-result advanced tt-suggestion", + }).append( '
' + '
' + '
' + @@ -237,8 +247,9 @@ $(document).ready(function() { '
' + 'Use Advanced Search' + '
' + - '
'+ - '
'); + '
' + ) + ); } });