Fix Navbar Search after new DB Schema (#60)

Fix Navbar Search after new DB Schema
This commit is contained in:
Qstick 2017-08-19 22:46:11 -04:00 committed by GitHub
parent 2575403c6b
commit 0da6f6e3c7
1 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ var substringMatcher = function() {
return function findMatches (q, cb) {
var matches = _.select(ArtistCollection.toJSON(), function(artist) {
return artist.artistName.toLowerCase().indexOf(q.toLowerCase()) > -1;
return artist.name.toLowerCase().indexOf(q.toLowerCase()) > -1;
});
cb(matches);
};
@ -26,13 +26,13 @@ $.fn.bindSearch = function() {
minLength : 1
}, {
name : 'artist',
displayKey : 'artistName',
displayKey : 'name',
source : substringMatcher()
});
$(this).on('typeahead:selected typeahead:autocompleted', function(e, artist) {
this.blur();
$(this).val('');
Backbone.history.navigate('/artist/{0}'.format(artist.artistSlug), { trigger : true });
Backbone.history.navigate('/artist/{0}'.format(artist.nameSlug), { trigger : true });
});
};