mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
31 lines
634 B
JavaScript
31 lines
634 B
JavaScript
|
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);
|