mirror of
https://github.com/SuperBFG7/ympd
synced 2025-02-01 19:59:17 +00:00
fix filtering with pagination
This commit is contained in:
parent
db72139490
commit
a3ae8cd802
@ -68,7 +68,7 @@ var app = $.sammy(function() {
|
||||
pagination = parseInt(this.params['splat'][0]);
|
||||
current_app = 'browse';
|
||||
$('#breadcrump').removeClass('hide').empty().append("<li><a uri=\"\" onclick=\"set_filter('')\">root</a></li>");
|
||||
$('#filter').removeClass('hide');
|
||||
add_filter();
|
||||
$('#salamisandwich').removeClass('hide').find("tr:gt(0)").remove();
|
||||
$('#dirble_panel').addClass('hide');
|
||||
socket.send('MPD_API_GET_BROWSE,'+pagination+','+(browsepath ? browsepath : "/"));
|
||||
@ -185,8 +185,6 @@ $(document).ready(function(){
|
||||
else
|
||||
if ($.cookie("notification") === "true")
|
||||
$('#btnnotify').addClass("active")
|
||||
|
||||
add_filter();
|
||||
});
|
||||
|
||||
function webSocketConnect() {
|
||||
@ -314,7 +312,7 @@ function webSocketConnect() {
|
||||
case 'directory':
|
||||
var clazz = 'dir';
|
||||
if (filter !== "") {
|
||||
var first = obj.data[item].dir[0];
|
||||
var first = basename(obj.data[item].dir)[0];
|
||||
if (filter === "num" && isNaN(first)) {
|
||||
clazz += ' hide';
|
||||
} else if (filter >= "A" && filter <= "Z" && first.toUpperCase() !== filter) {
|
||||
@ -1107,6 +1105,7 @@ function set_filter (c) {
|
||||
}
|
||||
|
||||
function add_filter () {
|
||||
$('#filter').empty();
|
||||
$('#filter').append(' <a onclick="set_filter(\'\')" href="#/browse/'+pagination+'/'+browsepath+'">All</a>');
|
||||
$('#filter').append(' <a id="fnum" onclick="set_filter(\'num\')" href="#/browse/'+pagination+'/'+browsepath+'">#</a>');
|
||||
|
||||
@ -1116,4 +1115,6 @@ function add_filter () {
|
||||
}
|
||||
|
||||
$('#filter').append(' <a id="fplist" onclick="set_filter(\'plist\')" href="#/browse/'+pagination+'/'+browsepath+'" class="glyphicon glyphicon-list"></a>');
|
||||
$('#f' + filter).addClass('active');
|
||||
$('#filter').removeClass('hide');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user