Commit e648a6f5 authored by Ciaran Ainsworth's avatar Ciaran Ainsworth Committed by Ciaran Ainsworth
Browse files

Added feature to search for artist by pressing return

parent 0e652103
Pipeline #4486 passed with stages
in 3 minutes and 50 seconds
......@@ -33,6 +33,18 @@ export default {
let albumLabel = this.$pgettext('*/*/*', 'Album')
let trackLabel = this.$pgettext('*/*/*/Noun', 'Track')
let self = this
var searchQuery;
jQuery(this.$el).keypress(function(e) {
if(e.which == 13) {
// Cancel any API search request to backend...
jQuery(this.$el).search('cancel query');
// Go direct to the artist page...
router.push("/library/artists?query=" + searchQuery + "&page=1&paginateBy=25&ordering=name");
}
});
jQuery(this.$el).search({
type: 'category',
minCharacters: 3,
......@@ -41,6 +53,7 @@ export default {
},
onSearchQuery (query) {
self.$emit('search')
searchQuery = query;
},
apiSettings: {
beforeXHR: function (xhrObject) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment