mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Filtering between selector lists
This commit is contained in:
@@ -25,6 +25,9 @@ Darkswarm.directive "filterSelector", (FilterSelectorsService)->
|
||||
scope.$on 'loadFilterSelectors', ->
|
||||
scope.allSelectors = scope.selectors()
|
||||
|
||||
scope.$watchCollection "selectors()", (newValue, oldValue) ->
|
||||
scope.allSelectors = scope.selectors()
|
||||
|
||||
# Build a list of selectors
|
||||
scope.selectors = ->
|
||||
# Generate a selector for each object.
|
||||
|
||||
@@ -62,8 +62,8 @@ Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) ->
|
||||
if scope.allSelectors?
|
||||
scope.fitting = true
|
||||
selector.fits = true for selector in scope.allSelectors
|
||||
loadWidths()
|
||||
fit()
|
||||
$timeout(loadWidths, 0, true).then ->
|
||||
$timeout fit, 0, true
|
||||
|
||||
$(window).resize debouncer (e) ->
|
||||
scope.fitting = true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.filter-shopfront.taxon-selectors.animate-hide.text-right
|
||||
%single-line-selectors{ objects: "Products.products | products:query | taxonsOf", "active-selectors" => "activeTaxons"}
|
||||
%single-line-selectors{ objects: "Products.products | products:query | properties: activeProperties | taxonsOf", "active-selectors" => "activeTaxons"}
|
||||
|
||||
.filter-shopfront.property-selectors.animate-hide.text-right
|
||||
%single-line-selectors{ objects: "Products.products | products:query | propertiesOf", "active-selectors" => "activeProperties"}
|
||||
%single-line-selectors{ objects: "Products.products | products:query | taxons:activeTaxons | propertiesOf", "active-selectors" => "activeProperties"}
|
||||
|
||||
Reference in New Issue
Block a user