From 77d5abf6d88b1f15276c4fbc568eea15928900e7 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 15 Sep 2013 15:33:23 -0400 Subject: [PATCH] added players filter to games view --- dashboard-ui/games.html | 18 ++++++++++++++++++ dashboard-ui/scripts/gamespage.js | 25 ++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/dashboard-ui/games.html b/dashboard-ui/games.html index c015b18f6..fd20eed9a 100644 --- a/dashboard-ui/games.html +++ b/dashboard-ui/games.html @@ -99,6 +99,24 @@ +
+ + Players: + + + + + + + + + + + + + +
+
Features: diff --git a/dashboard-ui/scripts/gamespage.js b/dashboard-ui/scripts/gamespage.js index 72750a228..8453379a2 100644 --- a/dashboard-ui/scripts/gamespage.js +++ b/dashboard-ui/scripts/gamespage.js @@ -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');