Adding entire album or artist to playlist, -add- icon. closes #35
This commit is contained in:
@@ -28,12 +28,18 @@ $(function(){
|
||||
}).disableTextSelect();
|
||||
$('.tracks .play').click(function(){
|
||||
addToPlaylist(
|
||||
$('h1.artist').html(),
|
||||
$('h1.artist > span > span:first').html(),
|
||||
$(this).parent().find('.track-name').html(),
|
||||
Math.round($(this).parent().find('.duration').attr('data-length') / 1000),
|
||||
$(this).parent().attr('id')
|
||||
);
|
||||
})
|
||||
$('.album > h3.name > span.play').click(function(){
|
||||
$(this).parent().parent().find('ul > li > span.play').click();
|
||||
})
|
||||
$('h1.artist > span > span.play').click(function(){
|
||||
$('.album > ul > li > span.play').click();
|
||||
})
|
||||
$('#player .prev').click(function(){
|
||||
playPrev();
|
||||
}).disableTextSelect();
|
||||
@@ -104,7 +110,7 @@ function playNext(auto) {
|
||||
}
|
||||
function addToPlaylist(artist, track, length, id) {
|
||||
$('#playlist ul.list').append($(
|
||||
'<li data-id="'+ id +'">'+
|
||||
'<li data-id="'+ id +'" title="Double-click To Play">'+
|
||||
'<span class="artist">'+ artist +'</span> — '+
|
||||
'<span class="track">'+ track +'</span>'+
|
||||
'<span class="length" data-seconds="'+ length +'">'+ formatTime(length) +'</span>'+
|
||||
|
||||
Reference in New Issue
Block a user