(function ($, document, apiClient) { function deleteTimer(page, id) { Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Cancellation", function (result) { if (result) { Dashboard.showLoadingMsg(); ApiClient.cancelLiveTvSeriesTimer(id).done(function () { Dashboard.alert('Series cancelled.'); reload(page); }); } }); } function renderTimers(page, timers) { var html = ''; html += ''; $('#items', page).html(html).trigger('create'); Dashboard.hideLoadingMsg(); } function reload(page) { Dashboard.showLoadingMsg(); apiClient.getLiveTvSeriesTimers().done(function (result) { renderTimers(page, result.Items); }); } $(document).on('pagebeforeshow', "#liveTvSeriesTimersPage", function () { var page = this; reload(page); }); })(jQuery, document, ApiClient);