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

31 lines
634 B
JavaScript
Raw Normal View History

2013-02-20 18:33:05 -07:00
var IndexPage = {
onPageShow: function () {
IndexPage.loadLibrary(Dashboard.getCurrentUserId(), this);
},
loadLibrary: function (userId, page) {
if (!userId) {
return;
}
page = $(page);
var options = {
sortBy: "SortName"
};
ApiClient.getItems(userId, options).done(function (result) {
$('#divCollections', page).html(Dashboard.getPosterViewHtml({
items: result.Items,
showTitle: true
}));
});
}
};
$(document).on('pageshow', "#indexPage", IndexPage.onPageShow);