jellyfin-web/dashboard-ui/scripts/channels.js
2015-05-19 15:15:40 -04:00

72 lines
1.7 KiB
JavaScript

(function ($, document) {
// The base query options
var query = {
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
query.UserId = Dashboard.getCurrentUserId();
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).done(function (result) {
// Scroll back up so they can see the results from the beginning
$(document).scrollTop(0);
var html = '';
updateFilterControls(page);
var view = 'Thumb';
if (view == "Thumb") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
context: 'channels',
showTitle: true,
centerText: true,
preferThumb: true
});
}
else if (view == "ThumbCard") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
preferThumb: true,
context: 'channels',
lazy: true,
cardLayout: true,
showTitle: true
});
}
$('#items', page).html(html).lazyChildren();
LibraryBrowser.saveQueryValues('channels', query);
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
}
$(document).on('pageshowready', "#channelsPage", function () {
LibraryBrowser.loadSavedQueryValues('channels', query);
reloadItems(this);
updateFilterControls(this);
});
})(jQuery, document);