Adding entire album or artist to playlist, -add- icon. closes #35

This commit is contained in:
magnolia-fan
2011-04-13 02:14:06 +04:00
parent 74b4c1e04a
commit 78c759562e
4 changed files with 63 additions and 17 deletions
+8 -2
View File
@@ -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> &mdash; '+
'<span class="track">'+ track +'</span>'+
'<span class="length" data-seconds="'+ length +'">'+ formatTime(length) +'</span>'+