Sha256: 2103d6e5e87f91d87b5098a1bb8995e2b18c1c9c8c4bcc71cfce5398d765a710
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
<div id="suggestion-search"> <input class="uikit-text-input uikit-text-input--block search-input" placeholder="{{ include.placeholder }}" type="text"> </div> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(e) { var getSearchTermsFromTokensAndDescription = function(obj) { return obj.tokens.concat(obj.shortDescription.split(' ')) }; var data = new Bloodhound({ datumTokenizer: getSearchTermsFromTokensAndDescription, queryTokenizer: Bloodhound.tokenizers.whitespace, local: searchResults }); $('#suggestion-search .search-input').typeahead({ classNames: { wrapper: 'search-input-wrapper', menu: 'suggestion-search-menu', cursor: 'suggestion-search-item__highlighted' }, hint: true, highlight: true, minLength: 1 }, { name: 'data', source: data, display: 'shortDescription', templates: { suggestion: function(result) { return `<div class="search-list__item"><a href="${result.link}">${result.shortDescription}</a></div>`; }, } }); }); </script>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dta_rapid-1.3.8 | _includes/lists/suggestion-search.html |