fix issue with selecting songs in playlist

This commit is contained in:
Robin Appelman 2011-07-30 00:05:44 +02:00
parent 94e25ecb0c
commit aa7c6f057b
1 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ PlayList.render=function(){
event.stopPropagation(); event.stopPropagation();
if($(this).attr('checked')){ if($(this).attr('checked')){
$(this).parent().parent().addClass('selected'); $(this).parent().parent().addClass('selected');
if($('td.name input:checkbox').length==$('td.name input:checkbox:checked').length){ if($('tbody td.name input:checkbox').length==$('tbody td.name input:checkbox:checked').length){
$('#selectAll').attr('checked',true); $('#selectAll').attr('checked',true);
} }
}else{ }else{
@ -59,7 +59,7 @@ PlayList.render=function(){
} }
} }
PlayList.getSelected=function(){ PlayList.getSelected=function(){
return $('td.name input:checkbox:checked').parent().parent(); return $('tbody td.name input:checkbox:checked').parent().parent();
} }
PlayList.hide=function(){ PlayList.hide=function(){
$('#playlist').hide(); $('#playlist').hide();
@ -71,12 +71,12 @@ $(document).ready(function(){
$('#selectAll').click(function(){ $('#selectAll').click(function(){
if($(this).attr('checked')){ if($(this).attr('checked')){
// Check all // Check all
$('td.name input:checkbox').attr('checked', true); $('tbody td.name input:checkbox').attr('checked', true);
$('td.name input:checkbox').parent().parent().addClass('selected'); $('tbody td.name input:checkbox').parent().parent().addClass('selected');
}else{ }else{
// Uncheck all // Uncheck all
$('td.name input:checkbox').attr('checked', false); $('tbody td.name input:checkbox').attr('checked', false);
$('td.name input:checkbox').parent().parent().removeClass('selected'); $('tbody td.name input:checkbox').parent().parent().removeClass('selected');
} }
procesSelection(); procesSelection();
}); });