Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var searchInput = $(this).typeahead({
- hint: true,
- highlight: true,
- minLength: minLength
- },
- {
- name: 'tooltips',
- limit: 100,
- source: searchResults.ttAdapter(),
- display: function(data) {
- var value = searchInput.typeahead('val');
- if (data.type === 'performer' || data.type === 'event' || data.type === 'venue') {
- value = data.title;
- }
- return value;
- },
- templates: {
- empty:
- '<div class="tasearch-no-results">' +
- 'Unable to find any performer, venue or event that match the current query' +
- '</div>',
- suggestion: function (data) {
- var text = "";
- if (data.type === 'all') {
- text = "<div class='tasearch-all-results'><a href='#'>"+data.title+"</a></div>";
- }
- if (data.type === 'heading') {
- text = "<div class='tasearch-heading "+data.dataType+"'>"+data.title+"</div>";
- }
- if (data.type === 'performer') {
- text = "<div class=''><a href='"+data.url+"'>"+data.title+"</a></div>"
- }
- if (data.type === 'event') {
- text = "<div class=''><a href='"+data.url+"'>"+data.title+"<div class='info'>"+data.eventDate+" | "+ data.vName+"</div></a></div>";
- }
- if (data.type === 'venue') {
- text = "<div class=''><a href='"+data.url+"'>"+data.title+"<div class='info'>"+data.city+" | "+ data.state+"</div></a></div>"
- }
- return text;
- }
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement