dont show play and add-to-playlist at the same time

This commit is contained in:
Robin Appelman 2011-07-31 01:25:33 +02:00
parent 77b558885a
commit 0b44db954f
2 changed files with 27 additions and 17 deletions

View File

@ -24,6 +24,7 @@ $(document).ready(function(){
data[itemParts[0]]=decodeURIComponent(itemParts[1]).replace(/\+/g,' '); data[itemParts[0]]=decodeURIComponent(itemParts[1]).replace(/\+/g,' ');
} }
var media=Collection.find(data.artist,data.album,data.song); var media=Collection.find(data.artist,data.album,data.song);
if(!PlayList.playing()){
var button=$('<input type="button" class="play"></input>'); var button=$('<input type="button" class="play"></input>');
button.css('background-image','url('+OC.imagePath('core','actions/play')+')') button.css('background-image','url('+OC.imagePath('core','actions/play')+')')
button.click(function(){ button.click(function(){
@ -33,6 +34,7 @@ $(document).ready(function(){
PlayList.render(); PlayList.render();
}); });
row.find('div.name').append(button); row.find('div.name').append(button);
}else{
var button=$('<input type="button" class="add"></input>'); var button=$('<input type="button" class="add"></input>');
button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')') button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
button.click(function(){ button.click(function(){
@ -41,6 +43,7 @@ $(document).ready(function(){
}); });
row.find('div.name').append(button); row.find('div.name').append(button);
} }
}
}); });

View File

@ -104,5 +104,12 @@ var PlayList={
PlayList.items.splice(index,1); PlayList.items.splice(index,1);
PlayList.render(); PlayList.render();
}, },
render:function(){} render:function(){},
playing:function(){
if(!PlayList.player){
return false;
}else{
return !PlayList.player.data("jPlayer").status.paused;
}
}
} }