From afface7fa724ab5b1ef4257b08a884718142aa52 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 2 Apr 2014 21:01:12 -0500 Subject: [PATCH] filter by current species --- app/assets/javascripts/outfits/edit.js | 3 ++- app/assets/javascripts/wardrobe.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/outfits/edit.js b/app/assets/javascripts/outfits/edit.js index 296e1bb0..72ee1e7b 100644 --- a/app/assets/javascripts/outfits/edit.js +++ b/app/assets/javascripts/outfits/edit.js @@ -1144,7 +1144,8 @@ View.Search = function (wardrobe) { nc: $('#advanced-search-nc').val(), occupies: $('#advanced-search-occupies').val(), restricts: $('#advanced-search-restricts').val(), - species: $('#advanced-search-species').val(), + species: $('#advanced-search-species').is(":checked") ? + wardrobe.outfits.getPetType().species_id : null, owns: $('#advanced-search-owns').val(), wants: $('#advanced-search-wants').val() }; diff --git a/app/assets/javascripts/wardrobe.js b/app/assets/javascripts/wardrobe.js index b247f486..50f6ae99 100644 --- a/app/assets/javascripts/wardrobe.js +++ b/app/assets/javascripts/wardrobe.js @@ -1330,6 +1330,9 @@ function Wardrobe() { if (query.restricts) filters.push({key: "restricted_zone_set_name", value: query.restricts, is_positive: true}); + if (query.species) + filters.push({key: "species_support_id", value: query.species, + is_positive: true}); return filters; }