mirror of
https://github.com/SuperBFG7/ympd
synced 2025-06-11 10:54:10 +00:00
Fixed issue #11 Pressing "Enter" in search field navigates to Playback tab
Fixed issue #12 Show search results for words with two characters
This commit is contained in:
parent
8bf7729633
commit
5cf9b5fcf2
@ -85,7 +85,7 @@ var app = $.sammy(function() {
|
|||||||
$('#cardQueue').removeClass('hide');
|
$('#cardQueue').removeClass('hide');
|
||||||
$('#navQueue').addClass('active');
|
$('#navQueue').addClass('active');
|
||||||
}
|
}
|
||||||
if (searchstr.length >= 3) {
|
if (searchstr.length >= 2) {
|
||||||
socket.send('MPD_API_SEARCH_QUEUE,' + mpdtag + ','+pagination+',' + searchstr);
|
socket.send('MPD_API_SEARCH_QUEUE,' + mpdtag + ','+pagination+',' + searchstr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -191,7 +191,7 @@ var app = $.sammy(function() {
|
|||||||
$('#cardSearch').removeClass('hide');
|
$('#cardSearch').removeClass('hide');
|
||||||
$('#navSearch').addClass('active');
|
$('#navSearch').addClass('active');
|
||||||
}
|
}
|
||||||
if (searchstr.length >= 3) {
|
if (searchstr.length >= 2) {
|
||||||
socket.send('MPD_API_SEARCH,' + mpdtag + ','+pagination+',' + searchstr);
|
socket.send('MPD_API_SEARCH,' + mpdtag + ','+pagination+',' + searchstr);
|
||||||
} else {
|
} else {
|
||||||
$('#searchList > tbody').empty();
|
$('#searchList > tbody').empty();
|
||||||
@ -1069,13 +1069,17 @@ function doSearch(searchstr) {
|
|||||||
app.setLocation('#/search/' + pagination + '/' + mpdtag + '/' + searchstr);
|
app.setLocation('#/search/' + pagination + '/' + mpdtag + '/' + searchstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#search2').submit(function () {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
function addAllFromSearch() {
|
function addAllFromSearch() {
|
||||||
var mpdtag='Any Tag';
|
var mpdtag='Any Tag';
|
||||||
$('#searchtags2 > button').each(function() {
|
$('#searchtags2 > button').each(function() {
|
||||||
if ($(this).hasClass('btn-success')) { mpdtag=$(this).text(); }
|
if ($(this).hasClass('btn-success')) { mpdtag=$(this).text(); }
|
||||||
});
|
});
|
||||||
var searchstr=$('#searchstr2').val();
|
var searchstr=$('#searchstr2').val();
|
||||||
if (searchstr.length >= 3) {
|
if (searchstr.length >= 2) {
|
||||||
socket.send('MPD_API_SEARCH_ADD,' + mpdtag + ',' + searchstr);
|
socket.send('MPD_API_SEARCH_ADD,' + mpdtag + ',' + searchstr);
|
||||||
var rowCount = $('#searchList >tbody >tr').length;
|
var rowCount = $('#searchList >tbody >tr').length;
|
||||||
showNotification('Added '+rowCount+' songs from search','','','success');
|
showNotification('Added '+rowCount+' songs from search','','','success');
|
||||||
@ -1119,6 +1123,10 @@ $('#searchqueue').submit(function () {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#searchqueue').submit(function () {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
function scrollToTop() {
|
function scrollToTop() {
|
||||||
document.body.scrollTop = 0; // For Safari
|
document.body.scrollTop = 0; // For Safari
|
||||||
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
|
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
|
||||||
|
Loading…
x
Reference in New Issue
Block a user