Sha256: d9efbcc1be9261f07116d593451f7178493e96ad0fec401a1d82f499618e13e3
Contents?: true
Size: 789 Bytes
Versions: 75
Compression:
Stored size: 789 Bytes
Contents
/*global Bloodhound */ import Bloodhound from 'typeahead.js/dist/bloodhound.js' Blacklight.onLoad(function() { 'use strict'; $('[data-autocomplete-enabled="true"]').each(function() { var $el = $(this); if($el.hasClass('tt-hint')) { return; } var suggestUrl = $el.data().autocompletePath; var terms = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: suggestUrl + '?q=%QUERY', wildcard: '%QUERY' } }); terms.initialize(); $el.typeahead({ hint: true, highlight: true, minLength: 2 }, { name: 'terms', displayKey: 'term', source: terms.ttAdapter() }); }); });
Version data entries
75 entries across 75 versions & 2 rubygems