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

added players filter to games view

This commit is contained in:
Luke Pulverenti 2013-09-15 15:33:23 -04:00
parent a67cfcd763
commit 77d5abf6d8
2 changed files with 42 additions and 1 deletions

View file

@ -99,6 +99,24 @@
<label for="chkDislikes">Dislikes</label>
</fieldset>
<fieldset data-role="controlgroup">
<legend>
<strong>Players:</strong>
</legend>
<input class="radioPlayers" data-theme="c" type="radio" name="radioPlayers" id="radioAll" value="on" checked="checked" data-value="all" data-mini="true">
<label for="radioAll">Any</label>
<input class="radioPlayers" data-theme="c" type="radio" name="radioPlayers" id="radioTwo" value="off" data-value="2" data-mini="true">
<label for="radioTwo">2+</label>
<input class="radioPlayers" data-theme="c" type="radio" name="radioPlayers" id="radioThree" value="off" data-value="3" data-mini="true">
<label for="radioThree">3+</label>
<input class="radioPlayers" data-theme="c" type="radio" name="radioPlayers" id="radioFour" value="off" data-value="4" data-mini="true">
<label for="radioFour">4+</label>
</fieldset>
<fieldset data-role="controlgroup">
<legend>
<strong>Features:</strong>

View file

@ -99,6 +99,17 @@
reloadItems(page);
});
$('.radioPlayers', this).on('click', function () {
query.StartIndex = 0;
var val = this.getAttribute('data-value');
query.MinPlayers = val == "all" ? null : val;
reloadItems(page);
});
$('.chkStandardFilter', this).on('change', function () {
var filterName = this.getAttribute('data-filter');
@ -197,6 +208,19 @@
}).checkboxradio('refresh');
$('.radioPlayers', this).each(function () {
var val = this.getAttribute('data-value');
if (val == "all") {
this.checked = query.MinPlayers == null;
} else {
this.checked = query.MinPlayers == val;
}
}).checkboxradio('refresh');
$('.chkStandardFilter', this).each(function () {
var filters = "," + (query.Filters || "");
@ -206,7 +230,6 @@
}).checkboxradio('refresh');
$('#selectView', this).val(view).selectmenu('refresh');
$('#chkTrailer', this).checked(query.HasTrailer == true).checkboxradio('refresh');