ready4testing
This commit is contained in:
@@ -30,6 +30,7 @@ var Radio = function() {
|
||||
var channel = channels[idx];
|
||||
var $tile = $tileTemplate.clone();
|
||||
|
||||
$tile.attr('data-id', idx);
|
||||
fillTileWithChannel($tile, channel);
|
||||
addClickToTile($tile);
|
||||
|
||||
@@ -55,8 +56,29 @@ var Radio = function() {
|
||||
$tile.click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$navigation.find('.tile').removeClass('nowplaying');
|
||||
|
||||
var stream = $tile.attr('href');
|
||||
var idx = $tile.attr('data-id');
|
||||
console.log('Stream: ' + stream);
|
||||
|
||||
$.ajax({
|
||||
url: '/action/play/'+idx+'/',
|
||||
context: document.body,
|
||||
statusCode: {
|
||||
200: function() {
|
||||
console.log('ok');
|
||||
},
|
||||
404: function() {
|
||||
console.log('Resource not found');
|
||||
},
|
||||
500: function() {
|
||||
console.log('Something went wrong');
|
||||
}
|
||||
}
|
||||
}).done(function() {
|
||||
$tile.addClass('nowplaying');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user