Skip to content

Commit ac3d8f9

Browse files
category function works now
1 parent bbd60c4 commit ac3d8f9

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

javascripts/data.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ NH.data = NH.data || {};
1616

1717
var healthyMarkets = [];
1818

19+
data.setCategory = function(category){
20+
yelpCategories = [];
21+
yelpCategories.push(category);
22+
23+
}
1924

2025
var showHealthyMarketSearchResults = function(){
2126

javascripts/search.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ var updatedDirections = function(){
5959
var t_lon = Math.max(resultLeg.start_location.B, resultLeg.end_location.B);
6060
var b_lon = Math.min(resultLeg.start_location.B, resultLeg.end_location.B);
6161

62+
NH.data.setCategory($('#category_filter').val());
63+
6264
var def = NH.data.getHealthyMarkets(t_lat, b_lat, t_lon, b_lon);
6365
}
6466

search.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
Category:
5555
</span>
5656
<div class="styled-select">
57-
<select>
58-
<option value="disabled">Select Category</option>
57+
<select id="category_filter">
58+
<option value="healthmarkets">Health Markets</option>
5959
<optgroup label="Food">
6060
<option value="food">All</option>
6161
<option value="bagels">Bagels</option>
@@ -88,7 +88,6 @@
8888
<option value="chocolate">Chocolatiers & Shops</option>
8989
<option value="ethnicmarkets">Ethnic Food</option>
9090
<option value="markets">Fruits & Veggies</option>
91-
<option value="healthmarkets">Health Markets</option>
9291
<option value="herbsandspices">Herbs & Spices</option>
9392
<option value="meats">Meat Shops</option>
9493
<option value="seafoodmarkets">Seafood Markets</option>

0 commit comments

Comments
 (0)