Skip to content
Snippets Groups Projects
Commit 7ad1b893 authored by boyska's avatar boyska
Browse files

now songbox handles "parent" songlist directly

parent 57ab6b65
No related branches found
No related tags found
1 merge request!2New UI: boxed
......@@ -58,7 +58,16 @@ $.widget('djrandom.songbox', $.djrandom.songlist, {
click(function() {
$('.playlist li', box).remove();
}));
box.append($('<a/>').addClass('btn action-appendall').text('Append all'));
var appendall = $('<a/>').addClass('btn action-appendall').text('Append all');
box.append(appendall);
appendall.click(function() {
var slist = $(box).songbox('option', 'parentlist');
if(slist !== null) {
$(box).songbox('getSongs').each(function(i, song) {
slist.songlist('addSong', song);
});
}
});
box.append($('<a/>').addClass('btn action-nextall').text('Play all as next song'));
this._super();
},
......
......@@ -69,13 +69,8 @@ jQuery(function($) {
$(this).addClass('sorted');
}
});
$('#resultsBox').songbox();
$('#suggestionsBox').songbox();
$('.songbox').on('click', '.action-appendall', function() {
$(this).parent(':djrandom-songbox, :djrandom-songlist').songlist('getSongs').map(function(idx, song) {
$('#playing').songlist('addSong', song);
});
})
$('#resultsBox').songbox({parentlist: $('#playing')});
$('#suggestionsBox').songbox({parentlist: $('#playing')});
$('.songlist .playlist').on('click', '.action-suggest', function() {
songel = $(this).parent('li');
suggest_in_box([songel.data('song').id]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment