jellyfin-web/dashboard-ui/scripts/channels.js

56 lines
1.3 KiB
JavaScript
Raw Normal View History

2014-03-18 10:05:57 -07:00
(function ($, document) {
// The base query options
var query = {
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
query.UserId = Dashboard.getCurrentUserId();
2014-07-01 22:16:59 -07:00
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).done(function (result) {
2014-03-18 10:05:57 -07:00
// Scroll back up so they can see the results from the beginning
$(document).scrollTop(0);
var html = '';
updateFilterControls(page);
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
2014-05-02 21:20:04 -07:00
shape: "backdrop",
2014-03-18 10:05:57 -07:00
context: 'channels',
showTitle: true,
2014-05-02 21:20:04 -07:00
centerText: true,
preferThumb: true
2014-03-18 10:05:57 -07:00
});
2015-01-22 23:15:15 -07:00
$('#items', page).html(html).lazyChildren();
2014-03-18 10:05:57 -07:00
LibraryBrowser.saveQueryValues('channels', query);
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
}
$(document).on('pagebeforeshow', "#channelsPage", function () {
LibraryBrowser.loadSavedQueryValues('channels', query);
reloadItems(this);
}).on('pageshow', "#channelsPage", function () {
updateFilterControls(this);
});
})(jQuery, document);