Adding handling of 'current hub'

This commit is contained in:
Will Marshall
2014-04-25 11:32:02 +10:00
parent f57020d190
commit 2212156f00
11 changed files with 25 additions and 10 deletions

View File

@@ -1,9 +1,12 @@
Darkswarm.controller "HubNodeCtrl", ($scope, Navigation, $location, $anchorScroll, $templateCache) ->
Darkswarm.controller "HubNodeCtrl", ($scope, Navigation, $location, $anchorScroll, $templateCache, CurrentHub) ->
$scope.toggle = ->
Navigation.navigate $scope.hub.path
$scope.open = ->
$location.path() == $scope.hub.path
$scope.current = ->
$scope.hub.id is CurrentHub.id
if $scope.open()
$anchorScroll()