And patching bugs in nav

This commit is contained in:
Will Marshall
2014-05-08 16:59:18 +10:00
parent d07ecb742b
commit ab64de5838
3 changed files with 11 additions and 4 deletions

View File

@@ -14,3 +14,6 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, $location, $anchorS
$scope.changeHub = ->
if confirm "Are you sure? This will change your selected Hub and remove any items in you shopping cart."
Navigation.go $scope.hub.path
if $scope.open()
$anchorScroll()

View File

@@ -1,3 +1,7 @@
Darkswarm.controller "HubsCtrl", ($scope, Hubs) ->
Darkswarm.controller "HubsCtrl", ($scope, Hubs, $anchorScroll, $rootScope, HashNavigation) ->
$scope.Hubs = Hubs
$scope.hubs = Hubs.hubs
$rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) ->
if HashNavigation.active "hubs"
$anchorScroll()

View File

@@ -1,9 +1,9 @@
Darkswarm.controller "ProducerNodeCtrl", ($scope, Navigation, $anchorScroll) ->
Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll) ->
$scope.toggle = ->
Navigation.navigate $scope.producer.path
HashNavigation.navigate $scope.producer.hash
$scope.open = ->
Navigation.active($scope.producer.path)
HashNavigation.active($scope.producer.hash)
if $scope.open()
$anchorScroll()