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

always show paging

This commit is contained in:
Luke Pulverenti 2013-04-19 12:28:06 -04:00
parent 414feaf3a2
commit 8f85dce021
19 changed files with 66 additions and 121 deletions

View file

@ -21,20 +21,16 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
useAverageAspectRatio: true
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Games"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -23,9 +23,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
for (var i = 0, length = result.Items.length; i < length; i++) {
var item = result.Items[i];
@ -41,11 +39,9 @@
}
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Games"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -22,20 +22,16 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
useAverageAspectRatio: true
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -254,18 +254,14 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
useAverageAspectRatio: true
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create');

View file

@ -22,9 +22,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
@ -40,11 +38,9 @@
});
}
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -362,7 +362,7 @@
return "<div class='posterRibbon'>New</div>";
}
} catch (err) {
}
}
@ -492,15 +492,24 @@
var recordsEnd = Math.min(query.StartIndex + query.Limit, totalRecordCount);
var showControls = totalRecordCount > query.Limit;
html += '<div class="listPaging">';
html += '<span style="margin-right: 10px;">';
html += (query.StartIndex + 1) + '-' + recordsEnd + ' of ' + totalRecordCount + ', page ' + dropdownHtml + ' of ' + pageCount;
html += (query.StartIndex + 1) + '-' + recordsEnd + ' of ' + totalRecordCount;
if (showControls) {
html += ', page ' + dropdownHtml + ' of ' + pageCount;
}
html += '</span>';
html += '<button data-icon="arrow-left" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (query.StartIndex ? '' : 'disabled') + '>Previous Page</button>';
if (showControls) {
html += '<button data-icon="arrow-left" data-iconpos="notext" data-inline="true" data-mini="true" class="btnPreviousPage" ' + (query.StartIndex ? '' : 'disabled') + '>Previous Page</button>';
html += '<button data-icon="arrow-right" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (query.StartIndex + query.Limit > totalRecordCount ? 'disabled' : '') + '>Next Page</button>';
html += '<button data-icon="arrow-right" data-iconpos="notext" data-inline="true" data-mini="true" class="btnNextPage" ' + (query.StartIndex + query.Limit > totalRecordCount ? 'disabled' : '') + '>Next Page</button>';
}
html += '</div>';

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Movies"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -21,9 +21,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -32,11 +30,9 @@
countNamePlural: "Movies"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -22,9 +22,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
@ -40,11 +38,9 @@
});
}
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Movies"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -22,9 +22,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
@ -40,11 +38,9 @@
});
}
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
var elem = $('#items', page).html(html).trigger('create');
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Shows"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -21,9 +21,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -32,11 +30,9 @@
countNamePlural: "Shows"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -22,9 +22,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
if (view == "Backdrop") {
html += LibraryBrowser.getPosterDetailViewHtml({
@ -40,11 +38,9 @@
});
}
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;

View file

@ -20,9 +20,7 @@
var html = '';
var showPaging = result.TotalRecordCount > query.Limit;
$('.listTopPaging', page).html(showPaging ? LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true) : '').trigger('create');
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,
@ -31,11 +29,9 @@
countNamePlural: "Shows"
});
if (showPaging) {
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
var elem = $('#items', page).html(html).trigger('create');
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;