Remove duplicate filtering of visible enterprises

Increase readability of enterprises_controller.js.coffee.
This commit is contained in:
Maikel Linke
2016-03-30 13:11:18 +11:00
parent 3d31a37dd3
commit 21be27d722
2 changed files with 3 additions and 3 deletions

View File

@@ -44,8 +44,8 @@ Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, Enterpris
$scope.filterEnterprises = ->
es = Enterprises.hubs
$scope.nameMatches = enterpriseMatchesNameQueryFilter(es, true)
$scope.distanceMatches = enterpriseMatchesNameQueryFilter(es, false)
$scope.distanceMatches = distanceWithinKmFilter($scope.distanceMatches, 50)
noNameMatches = enterpriseMatchesNameQueryFilter(es, false)
$scope.distanceMatches = distanceWithinKmFilter(noNameMatches, 50)
$scope.updateVisibleMatches = ->

View File

@@ -1,5 +1,5 @@
.active_table
%hub.active_table_node.row{"ng-repeat" => "hub in #{enterprises}Filtered = (#{enterprises} | visible | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles | orderBy:['-active', '+distance', '+orders_close_at'])",
%hub.active_table_node.row{"ng-repeat" => "hub in #{enterprises}Filtered = (#{enterprises} | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles | orderBy:['-active', '+distance', '+orders_close_at'])",
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"ng-controller" => "HubNodeCtrl",
id: "{{hub.hash}}"}