mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Some text changes and similar magic
This commit is contained in:
@@ -2,6 +2,7 @@ Darkswarm.controller "ProducersCtrl", ($scope, Producers, $filter, FilterSelecto
|
||||
$scope.Producers = Producers
|
||||
$scope.totalActive = FilterSelectorsService.totalActive
|
||||
$scope.clearAll = FilterSelectorsService.clearAll
|
||||
$scope.filterText = FilterSelectorsService.filterText
|
||||
$scope.filtersActive = true
|
||||
$scope.activeTaxons = []
|
||||
$scope.query = Search.search()
|
||||
|
||||
@@ -13,6 +13,12 @@ Darkswarm.factory "FilterSelectorsService", ->
|
||||
selector.active
|
||||
.length
|
||||
|
||||
filterText: (active)=>
|
||||
if @totalActive() == 0
|
||||
if active then "Hide filters" else "Filter by"
|
||||
else
|
||||
"#{@totalActive()} filters active"
|
||||
|
||||
clearAll: =>
|
||||
for selector in @selectors
|
||||
selector.active = false
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
.row
|
||||
.small-12.columns
|
||||
%a.right{"ng-click" => "filtersActive = !filtersActive"}
|
||||
%span{"ng-show" => "!filtersActive && totalActive() == 0"}
|
||||
Filter by
|
||||
%i.ofn-i_052-point-down
|
||||
|
||||
%span{"ng-show" => "filtersActive && totalActive() == 0"}
|
||||
Hide filters
|
||||
%i.ofn-i_053-point-up
|
||||
|
||||
%span{"ng-show" => "totalActive() > 0"}
|
||||
{{ totalActive() }} filters applied
|
||||
%i.ofn-i_052-point-down{"ng-show" => "!filtersActive"}
|
||||
%i.ofn-i_053-point-up{"ng-show" => "filtersActive"}
|
||||
{{ filterText(filtersActive) }}
|
||||
%i.ofn-i_052-point-down{"ng-show" => "!filtersActive"}
|
||||
%i.ofn-i_053-point-up{"ng-show" => "filtersActive"}
|
||||
|
||||
.row.animate-show{"ng-show" => "filtersActive"}
|
||||
.small-12.columns
|
||||
|
||||
Reference in New Issue
Block a user