1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

continue jquery removal

This commit is contained in:
Luke Pulverenti 2016-06-17 14:35:21 -04:00
parent 8f05a7a53d
commit aa83844d85
3 changed files with 46 additions and 73 deletions

View file

@ -1,4 +1,4 @@
define(['jQuery'], function ($) {
define([], function () {
// The base query options
var data = {};
@ -16,8 +16,7 @@
IncludeItemTypes: "Movie",
Recursive: true,
Fields: "DateCreated,ItemCounts",
StartIndex: 0,
Limit: LibraryBrowser.getDefaultPageSize()
StartIndex: 0
}
};
@ -40,18 +39,8 @@
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
$('.listTopPaging', context).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false
}));
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
@ -64,20 +53,10 @@
});
var elem = context.querySelector('.itemsContainer');
var elem = context.querySelector('#items');
elem.innerHTML = html;
ImageLoader.lazyChildren(elem);
$('.btnNextPage', context).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(context, params);
});
$('.btnPreviousPage', context).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(context, params);
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
Dashboard.hideLoadingMsg();
});