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/channels.js

73 lines
1.8 KiB
JavaScript
Raw Normal View History

2014-03-18 13:05:57 -04:00
(function ($, document) {
// The base query options
var query = {
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
query.UserId = Dashboard.getCurrentUserId();
2014-07-02 01:16:59 -04:00
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).done(function (result) {
2014-03-18 13:05:57 -04:00
// Scroll back up so they can see the results from the beginning
$(document).scrollTop(0);
var html = '';
updateFilterControls(page);
2015-05-13 00:55:19 -04:00
var view = 'Thumb';
if (view == "Thumb") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
context: 'channels',
showTitle: true,
2015-06-10 00:01:14 -04:00
lazy: true,
2015-05-13 00:55:19 -04:00
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 13:05:57 -04:00
2015-01-23 01:15:15 -05:00
$('#items', page).html(html).lazyChildren();
2014-03-18 13:05:57 -04:00
LibraryBrowser.saveQueryValues('channels', query);
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
}
2015-06-19 00:23:55 -04:00
$(document).on('pagebeforeshowready', "#channelsPage", function () {
2014-03-18 13:05:57 -04:00
LibraryBrowser.loadSavedQueryValues('channels', query);
reloadItems(this);
updateFilterControls(this);
});
})(jQuery, document);