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

fixes #506 - Song list - make columns headers clickable for sorting

This commit is contained in:
Luke Pulverenti 2013-09-06 15:17:15 -04:00
parent b7d236b9e4
commit 029f458651
5 changed files with 133 additions and 35 deletions

View file

@ -77,19 +77,31 @@
var page = this;
$('.radioSortBy', this).on('click', function () {
$('.radioSortBy', page).on('click', function () {
query.SortBy = this.getAttribute('data-sortby');
query.StartIndex = 0;
// Clear this
$('.alphabetPicker', page).alphaClear();
query.NameStartsWithOrGreater = '';
query.AlbumArtistStartsWithOrGreater = '';
reloadItems(page);
});
$('.radioSortOrder', this).on('click', function () {
$('.radioSortOrder', page).on('click', function () {
query.SortOrder = this.getAttribute('data-sortorder');
query.StartIndex = 0;
// Clear this
$('.alphabetPicker', page).alphaClear();
query.NameStartsWithOrGreater = '';
query.AlbumArtistStartsWithOrGreater = '';
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
$('.chkStandardFilter', page).on('change', function () {
var filterName = this.getAttribute('data-filter');
var filters = query.Filters || "";
@ -106,7 +118,7 @@
reloadItems(page);
});
$('#selectView', this).on('change', function () {
$('#selectView', page).on('change', function () {
view = this.value;
@ -121,9 +133,16 @@
}
});
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
$('.alphabetPicker', page).on('alphaselect', function (e, character) {
query.NameStartsWithOrGreater = character;
if (query.SortBy.indexOf('AlbumArtist') == -1) {
query.NameStartsWithOrGreater = character;
query.AlbumArtistStartsWithOrGreater = '';
} else {
query.AlbumArtistStartsWithOrGreater = character;
query.NameStartsWithOrGreater = '';
}
query.StartIndex = 0;
reloadItems(page);
@ -131,6 +150,7 @@
}).on('alphaclear', function (e) {
query.NameStartsWithOrGreater = '';
query.AlbumArtistStartsWithOrGreater = '';
reloadItems(page);
});