1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/livetvchannels.js
2014-01-07 13:39:35 -05:00

32 lines
No EOL
753 B
JavaScript

(function ($, document, apiClient) {
function getChannelsHtml(channels) {
return LibraryBrowser.getPosterViewHtml({
items: channels,
useAverageAspectRatio: true,
shape: "backdrop",
centerText: true
});
}
function renderChannels(page, channels) {
$('#items', page).html(getChannelsHtml(channels)).trigger('create');
}
$(document).on('pagebeforeshow', "#liveTvChannelsPage", function () {
var page = this;
apiClient.getLiveTvChannels({
userId: Dashboard.getCurrentUserId()
}).done(function (result) {
renderChannels(page, result.Items);
});
});
})(jQuery, document, ApiClient);