diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index e701d17476..009d777315 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -1,6 +1,7 @@ (function ($, document, apiClient) { var currentItem; + var programs; function getDisplayTime(date) { @@ -19,6 +20,14 @@ return date; } + function cancelRecording(page, id) { + + } + + function scheduleRecording(page, id) { + + } + function renderPrograms(page, result) { var html = ''; @@ -46,10 +55,10 @@ html += ''; - if (program.recordingId) { - html += ''; + if (program.RecordingId) { + html += ''; } else { - html += ''; + html += ''; } html += ''; @@ -78,7 +87,21 @@ html += ''; - $('#programList', page).html(html).trigger('create'); + var elem = $('#programList', page).html(html).trigger('create'); + + $('.btnCancelRecording', elem).on('click', function () { + + var recordingId = this.getAttribute('data-recordingid'); + + cancelRecording(page, recordingId); + }); + + $('.btnScheduleRecording', elem).on('click', function () { + + var recordingId = this.getAttribute('data-recordingid'); + + scheduleRecording(page, recordingId); + }); } function loadPrograms(page) { @@ -90,6 +113,9 @@ }).done(function (result) { renderPrograms(page, result); + programs = result.Items; + + Dashboard.hideLoadingMsg(); }); } @@ -136,7 +162,6 @@ loadPrograms(page); - Dashboard.hideLoadingMsg(); }); } @@ -168,6 +193,7 @@ }).on('pagehide', "#liveTvChannelPage", function () { currentItem = null; + programs = null; }); })(jQuery, document, ApiClient); \ No newline at end of file