fix toggle player button icon play / pause

This commit is contained in:
Jonas Heinrich 2018-08-04 13:43:07 +02:00
parent c812e5b0f8
commit 1707ed2c8d

View File

@ -56,7 +56,7 @@ $(function(){
}; };
}); });
/* Save station to favorites */ /* Save station to favorites */
$('body').on('click', '.favorite', function() { $('body').on('click', '.favorite', function() {
var stationid = $(this).parent().parent().attr('data-id'); var stationid = $(this).parent().parent().attr('data-id');
action_favorite(stationid); action_favorite(stationid);
@ -90,7 +90,10 @@ $(function(){
var music = document.getElementById('player'); var music = document.getElementById('player');
if (music.paused && $("#player").attr("src") != "") { if (music.paused && $("#player").attr("src") != "") {
music.play(); music.play();
} else { } else {
$('#playbutton').removeClass("pause");
$('#playbutton').addClass("play");
music.pause(); music.pause();
} }
}); });