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

View File

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