mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update filters
This commit is contained in:
parent
ea62d92da3
commit
a4af7eb246
2 changed files with 24 additions and 56 deletions
|
@ -4,7 +4,7 @@
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-require="jqmpanel,scripts/itemlistpage,paper-checkbox">
|
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-require="scripts/itemlistpage,paper-checkbox">
|
||||||
<div class="alphabetPicker">
|
<div class="alphabetPicker">
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content" class="itemListContent">
|
<div data-role="content" class="itemListContent">
|
||||||
|
@ -13,31 +13,7 @@
|
||||||
<div class="listTopPaging">
|
<div class="listTopPaging">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="items" class="itemsContainer" style="text-align:center;"></div>
|
<div id="items" class="itemsContainer paddedItemsContainer" style="text-align:center;"></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-role="panel" class="viewPanel hide" data-theme="b" data-position="right" data-display="overlay" data-position-fixed="true">
|
|
||||||
<div class="ui-panel-inner">
|
|
||||||
<form>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<h1>
|
|
||||||
${HeaderFilters}
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div class="paperCheckboxList">
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="IsPlayed">${OptionPlayed}</paper-checkbox>
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="IsUnPlayed">${OptionUnplayed}</paper-checkbox>
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="IsResumable">${OptionResumable}</paper-checkbox>
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="IsFavorite">${OptionFavorite}</paper-checkbox>
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="Likes">${OptionLikes}</paper-checkbox>
|
|
||||||
<paper-checkbox class="chkStandardFilter" data-filter="Dislikes">${OptionDislikes}</paper-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -69,13 +69,12 @@
|
||||||
startIndex: query.StartIndex,
|
startIndex: query.StartIndex,
|
||||||
limit: query.Limit,
|
limit: query.Limit,
|
||||||
totalRecordCount: result.TotalRecordCount,
|
totalRecordCount: result.TotalRecordCount,
|
||||||
viewButton: true,
|
|
||||||
showLimit: false,
|
showLimit: false,
|
||||||
addLayoutButton: true,
|
addLayoutButton: true,
|
||||||
currentLayout: view,
|
currentLayout: view,
|
||||||
viewIcon: 'filter-list',
|
|
||||||
sortButton: true,
|
sortButton: true,
|
||||||
layouts: 'Poster,PosterCard,Thumb'
|
layouts: 'Poster,PosterCard,Thumb',
|
||||||
|
filterButton: true
|
||||||
});
|
});
|
||||||
|
|
||||||
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||||
|
@ -121,6 +120,10 @@
|
||||||
elem.innerHTML = html + pagingHtml;
|
elem.innerHTML = html + pagingHtml;
|
||||||
ImageLoader.lazyChildren(elem);
|
ImageLoader.lazyChildren(elem);
|
||||||
|
|
||||||
|
$('.btnFilter', page).on('click', function () {
|
||||||
|
showFilterMenu(page);
|
||||||
|
});
|
||||||
|
|
||||||
$('.btnNextPage', page).on('click', function () {
|
$('.btnNextPage', page).on('click', function () {
|
||||||
query.StartIndex += query.Limit;
|
query.StartIndex += query.Limit;
|
||||||
reloadItems(page);
|
reloadItems(page);
|
||||||
|
@ -208,19 +211,26 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showFilterMenu(page) {
|
||||||
|
|
||||||
|
require(['components/filterdialog/filterdialog'], function (filterDialogFactory) {
|
||||||
|
|
||||||
|
var filterDialog = new filterDialogFactory({
|
||||||
|
query: getQuery()
|
||||||
|
});
|
||||||
|
|
||||||
|
Events.on(filterDialog, 'filterchange', function () {
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
filterDialog.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function updateFilterControls(page) {
|
function updateFilterControls(page) {
|
||||||
|
|
||||||
var query = getQuery();
|
var query = getQuery();
|
||||||
|
|
||||||
$('.chkStandardFilter', page).each(function () {
|
|
||||||
|
|
||||||
var filters = "," + (query.Filters || "");
|
|
||||||
var filterName = this.getAttribute('data-filter');
|
|
||||||
|
|
||||||
this.checked = filters.indexOf(',' + filterName) != -1;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
|
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,24 +252,6 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
$('.chkStandardFilter', this).on('change', function () {
|
|
||||||
|
|
||||||
var query = getQuery();
|
|
||||||
var filterName = this.getAttribute('data-filter');
|
|
||||||
var filters = query.Filters || "";
|
|
||||||
|
|
||||||
filters = (',' + filters).replace(',' + filterName, '').substring(1);
|
|
||||||
|
|
||||||
if (this.checked) {
|
|
||||||
filters = filters ? (filters + ',' + filterName) : filterName;
|
|
||||||
}
|
|
||||||
|
|
||||||
query.StartIndex = 0;
|
|
||||||
query.Filters = filters;
|
|
||||||
|
|
||||||
reloadItems(page);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
|
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
|
||||||
|
|
||||||
var query = getQuery();
|
var query = getQuery();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue