<ol id="breadcrump" class="breadcrumb">
</ol>
+ <div class="col-md-12">
+ <button id="add-all-songs" class="btn btn-primary pull-right">Add all</button>
+ </div>
+
+
<!-- Table -->
<table id="salamisandwich" class="table table-hover">
<thead>
function prepare() {
$('#nav_links > li').removeClass('active');
$('.page-btn').addClass('hide');
+ $('#add-all-songs').hide();
pagination = 0;
browsepath = '';
}
$('#breadcrump').removeClass('hide').empty().append("<li><a href=\"#/browse/0/\">root</a></li>");
$('#salamisandwich').find("tr:gt(0)").remove();
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);
var path_array = browsepath.split('/');