added page size selection

This commit is contained in:
Luke Pulverenti 2013-04-27 18:52:41 -04:00
parent 56cb3118df
commit cb3107a2b6
23 changed files with 162 additions and 7 deletions

View File

@ -56,6 +56,14 @@
margin: .5em 0 .25em;
}
.labelPageSize {
margin-left: 1em;
}
.labelPageSize, .selectPageSize {
display: none;
}
@media all and (min-width: 650px) {
.libraryPage .ui-content {
padding: 10px 20px 100px;
@ -68,6 +76,10 @@
.viewControls + .listTopPaging {
margin-left: 1em;
}
.labelPageSize, .selectPageSize {
display: inline;
}
}
@media all and (min-width: 750px) {
@ -538,4 +550,4 @@
.itemsContainer {
text-align: center;
}
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -58,6 +58,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -422,6 +422,12 @@
loadItems(page, query);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
loadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -57,6 +57,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});

View File

@ -253,7 +253,7 @@
if (item.Artists && item.Artists.length) {
var artist = item.Artists[0];
html += '<td><a href="itembynamedetails.html?context=music&artist=' + artist + '">' + artist + '</a></td>';
} else {
html += '<td></td>';
@ -283,7 +283,7 @@
}
itemByNameContext = itemByNameContext || "";
// Handle search hints
var id = item.Id || item.ItemId;
@ -652,6 +652,29 @@
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>';
var id = "selectPageSize" + new Date().getTime();
var options = '';
function getOption(val) {
if (query.Limit == val) {
return '<option value="' + val + '" selected="selected">' + val + '</option>';
} else {
return '<option value="' + val + '">' + val + '</option>';
}
}
options += getOption(20);
options += getOption(50);
options += getOption(100);
options += getOption(200);
options += getOption(300);
html += '<label class="labelPageSize" for="' + id + '">Limit: </label><select class="selectPageSize" id="' + id + '" data-enhance="false" data-role="none">' + options + '</select>';
}
html += '</div>';
@ -1372,7 +1395,7 @@
html += '<div class="posterViewItem" style="padding-bottom:0px;">';
html += '<a href="#pop_' + index + '_' + tag + '" data-transition="fade" data-rel="popup" data-position-to="window">';
html += '<img class="galleryImage" src="' + LibraryBrowser.getImageUrl(item, type, index, {
maxwidth: downloadWidth,
maxwidth: downloadWidth,
tag: tag
}) + '" />';
html += '</div>';
@ -1383,7 +1406,7 @@
maxwidth: lightboxWidth,
tag: tag
}) + '" />';
html += '</div>';

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -49,6 +49,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -60,6 +60,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -58,6 +58,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -46,6 +46,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -49,6 +49,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -59,6 +59,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -48,6 +48,12 @@
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
Dashboard.hideLoadingMsg();
});
}

View File

@ -33,8 +33,8 @@
<strong>Sort By:</strong>
</legend>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="Artist,Album,SortName" data-mini="true">
<label for="radioSortName">Name</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioArtistAlbumSortName" value="on" checked="checked" data-sortby="Artist,Album,SortName" data-mini="true">
<label for="radioArtistAlbumSortName">Artist, Album, Track</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioAlbum" value="on" checked="checked" data-sortby="Album" data-mini="true">
<label for="radioAlbum">Album</label>