app/javascript/spotlight/admin/block_mixins/autocompleteable.js in blacklight-spotlight-3.6.0.beta4 vs app/javascript/spotlight/admin/block_mixins/autocompleteable.js in blacklight-spotlight-3.6.0.beta5
- old
+ new
@@ -8,14 +8,10 @@
if (this['autocomplete_url'] === undefined) {
this.autocomplete_url = function() { return $('form[data-autocomplete-url]').data('autocomplete-url').replace("%25QUERY", "%QUERY"); };
}
- if (this['autocomplete_template'] === undefined) {
- this.autocomplete_url = function() { return '<div class="autocomplete-item{{#if private}} blacklight-private{{/if}}">{{#if thumbnail}}<div class="document-thumbnail"><img class="img-thumbnail" src="{{thumbnail}}" /></div>{{/if}}<span class="autocomplete-title">{{title}}</span><br/><small> {{description}}</small></div>' };
- }
-
if (this['transform_autocomplete_results'] === undefined) {
this.transform_autocomplete_results = (val) => val
}
if (this['autocomplete_control'] === undefined) {
@@ -33,10 +29,10 @@
};
}
},
addAutocompletetoSirTrevorForm: function() {
- $('[data-twitter-typeahead]', this.inner).spotlightSearchTypeAhead({bloodhound: this.bloodhound(), template: this.autocomplete_template()}).on('typeahead:selected typeahead:autocompleted', this.autocompletedHandler()).on( 'focus', function() {
+ $('[data-twitter-typeahead]', this.inner).spotlightSearchTypeAhead({bloodhound: this.bloodhound(), template: this.autocomplete_template}).on('typeahead:selected typeahead:autocompleted', this.autocompletedHandler()).on( 'focus', function() {
if($(this).val() === '') {
$(this).data().ttTypeahead.input.trigger('queryChanged', '');
}
});
},