mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-26 14:57:17 +00:00
Add "Add all" button in the Browse section
It adds all items in the directory. It's equivalent to clicking on "+" on that same directory we decided to browse.
This commit is contained in:
parent
f2164b382a
commit
4e2f300643
@ -97,6 +97,11 @@
|
|||||||
<ol id="breadcrump" class="breadcrumb">
|
<ol id="breadcrump" class="breadcrumb">
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<button id="add-all-songs" class="btn btn-primary pull-right">Add all</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Table -->
|
<!-- Table -->
|
||||||
<table id="salamisandwich" class="table table-hover">
|
<table id="salamisandwich" class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -41,6 +41,7 @@ var app = $.sammy(function() {
|
|||||||
function prepare() {
|
function prepare() {
|
||||||
$('#nav_links > li').removeClass('active');
|
$('#nav_links > li').removeClass('active');
|
||||||
$('.page-btn').addClass('hide');
|
$('.page-btn').addClass('hide');
|
||||||
|
$('#add-all-songs').hide();
|
||||||
pagination = 0;
|
pagination = 0;
|
||||||
browsepath = '';
|
browsepath = '';
|
||||||
}
|
}
|
||||||
@ -59,6 +60,15 @@ var app = $.sammy(function() {
|
|||||||
$('#breadcrump').removeClass('hide').empty().append("<li><a href=\"#/browse/0/\">root</a></li>");
|
$('#breadcrump').removeClass('hide').empty().append("<li><a href=\"#/browse/0/\">root</a></li>");
|
||||||
$('#salamisandwich').find("tr:gt(0)").remove();
|
$('#salamisandwich').find("tr:gt(0)").remove();
|
||||||
socket.send('MPD_API_GET_BROWSE,'+pagination+','+(browsepath ? browsepath : "/"));
|
socket.send('MPD_API_GET_BROWSE,'+pagination+','+(browsepath ? browsepath : "/"));
|
||||||
|
// Don't add all songs from root
|
||||||
|
if (browsepath) {
|
||||||
|
var add_all_songs = $('#add-all-songs');
|
||||||
|
add_all_songs.off(); // remove previous binds
|
||||||
|
add_all_songs.on('click', function() {
|
||||||
|
socket.send('MPD_API_ADD_TRACK,'+browsepath);
|
||||||
|
});
|
||||||
|
add_all_songs.show();
|
||||||
|
}
|
||||||
|
|
||||||
$('#panel-heading').text("Browse database: "+browsepath);
|
$('#panel-heading').text("Browse database: "+browsepath);
|
||||||
var path_array = browsepath.split('/');
|
var path_array = browsepath.split('/');
|
||||||
|
Loading…
Reference in New Issue
Block a user