mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Adding active boolean and sorting
This commit is contained in:
@@ -2,10 +2,9 @@ Darkswarm.controller "HubNodeCtrl", ($scope, Navigation, $location, $anchorScrol
|
||||
$scope.toggle = ->
|
||||
Navigation.navigate $scope.hub.path
|
||||
|
||||
$scope.active = ->
|
||||
$scope.open = ->
|
||||
$location.path() == $scope.hub.path
|
||||
|
||||
if $scope.active()
|
||||
console.log "scrolling baby"
|
||||
if $scope.open()
|
||||
$anchorScroll()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.factory 'Hubs', ($location, hubs) ->
|
||||
Darkswarm.factory 'Hubs', ($location, hubs, $filter) ->
|
||||
new class Hubs
|
||||
constructor: ->
|
||||
@hubs = hubs
|
||||
@hubs = $filter('orderBy')(hubs, 'active', true)
|
||||
|
||||
Reference in New Issue
Block a user