From 2d3d5c2d9bb13ea6374035fee47b29db570783d3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Apr 2013 14:56:40 -0400 Subject: [PATCH] added air days filters to the tv shows page --- dashboard-ui/scripts/tvshows.js | 25 +++++++++++++++++++++++++ dashboard-ui/tvshows.html | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 26d716f47c..dd9f8b2c42 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -143,6 +143,22 @@ reloadItems(page); }); + $('.chkAirDays', this).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.AirDays || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.AirDays = filters; + + reloadItems(page); + }); + }).on('pagebeforeshow', "#tvShowsPage", function () { reloadItems(this); @@ -179,6 +195,15 @@ this.checked = filters.indexOf(',' + filterName) != -1; }).checkboxradio('refresh'); + + $('.chkAirDays', this).each(function () { + + var filters = "," + (query.AirDays || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/tvshows.html b/dashboard-ui/tvshows.html index 9b88014d59..3da36a8ba2 100644 --- a/dashboard-ui/tvshows.html +++ b/dashboard-ui/tvshows.html @@ -84,6 +84,26 @@ + +
+ + Air Days: + + + + + + + + + + + + + + + +