Skip to content
Snippets Groups Projects
Commit 382834ec authored by Robin Appelman's avatar Robin Appelman
Browse files

highlight playing songs in collection

parent 686be824
Branches
No related tags found
No related merge requests found
......@@ -12,4 +12,5 @@ li button.right.prettybutton{font-size:1em;}
#collection li{padding-right:10px;}
#searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;}
#collection tr.collapsed td.album, #collection tr.collapsed td.title{color:#ddd}
a.expander{float:right;display:block}
a.expander{ float:right; display:block; }
tr.active { background-color:#ccc; }
......@@ -62,12 +62,16 @@ Collection={
event.preventDefault();
PlayList.add(song,true);
PlayList.play(0);
Collection.parent.find('tr').removeClass('active');
tr.addClass('active');
});
if(artist.artist_name!=lastArtist){
tr.find('td.artist a').click(function(event){
event.preventDefault();
PlayList.add(artist,true);
PlayList.play(0);
Collection.parent.find('tr').removeClass('active');
$('tr[data-artist="'+artist.artist_name+'"]').addClass('active');
});
tr.find('td.artist a').text(artist.artist_name);
if(artist.albums.length>1){
......@@ -89,6 +93,8 @@ Collection={
event.preventDefault();
PlayList.add(album,true);
PlayList.play(0);
Collection.parent.find('tr').removeClass('active');
$('tr[data-album="'+album.album_name+'"]').addClass('active');
});
tr.find('td.album a').text(album.album_name);
if(album.songs.length>1){
......@@ -149,10 +155,11 @@ Collection={
Collection.parent.hide();
}
},
registerPlay:function(){
var item=PlayList.items[PlayList.current];
var song=Collection.findSong(item.artist,item.album,item.name);
song.song_playcount++;
registerPlay:function(item){
if(item){
var song=Collection.findSong(item.artist,item.album,item.name);
song.song_playcount++;
}
},
addButtons:function(parent){
parent.children('button.add').click(function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment