forage-bootstrap
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -66,7 +66,12 @@ var app = angular.module('forageSearchUI', ['ngRoute', | ||
for (var i = 0; i < possibleFilters.length; i++) { | ||
if ($location.search()['filter[' + possibleFilters[i] + '][]']) | ||
if ($location.search()['filter[' + possibleFilters[i] + '][]']) { | ||
url += '&filter[' + possibleFilters[i] + '][]=' + | ||
$location.search()['filter[' + possibleFilters[i] + '][]']; | ||
} | ||
} | ||
url += '&teaser=body' | ||
if ($location.search()['facets']) { | ||
url += '&facets=' + $location.search()['facets']; | ||
} | ||
url += '&teaser=body'; | ||
console.log(url); | ||
$http.get(url).success(function(data) { | ||
@@ -78,5 +83,18 @@ console.log(url); | ||
if (data.query.filter) filter = data.query.filter; | ||
for (var i in data.facets) { | ||
//TODO deal with multiple values per filter | ||
if (!filter[i]) { | ||
var thisFacetCat = data.facets[i]; | ||
for (var k = 0; k < thisFacetCat.length; k++) { | ||
var nav = {}; | ||
nav['label'] = thisFacetCat[k].key; | ||
nav['count'] = thisFacetCat[k].value; | ||
nav['url'] = ('#/' + url + '&filter[' + | ||
i + '][]=' + thisFacetCat[k].key); | ||
if (!navs[i]) navs[i] = []; | ||
navs[i].push(nav); | ||
} | ||
/* | ||
for (var k in data.facets[i]) { | ||
@@ -91,4 +109,6 @@ var nav = {}; | ||
} | ||
*/ | ||
} | ||
} | ||
} | ||
// console.log(navs); | ||
@@ -95,0 +115,0 @@ var activeFilters = []; |
{ | ||
"name": "forage-bootstrap", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A lighweight bootstrap-angular.js frontend for Forage.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294443
209