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

72 lines
1.7 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);
2015-05-12 21:55:19 -07:00
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
});
}
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) {
}
2015-05-16 12:09:02 -07:00
$(document).on('pageshown', "#channelsPage", function () {
2014-03-18 10:05:57 -07:00
LibraryBrowser.loadSavedQueryValues('channels', query);
reloadItems(this);
updateFilterControls(this);
});
})(jQuery, document);