Popup dialog when changing hub:

This commit is contained in:
Will Marshall
2014-04-25 12:11:09 +10:00
parent 22dc8cbfa0
commit b7f28c8d82
3 changed files with 8 additions and 1 deletions

View File

@@ -11,6 +11,10 @@ Darkswarm.controller "HubNodeCtrl", ($scope, Navigation, $location, $anchorScrol
$scope.emptiesCart = ->
CurrentHub.id isnt undefined and !$scope.current()
$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

@@ -9,3 +9,6 @@ Darkswarm.factory 'Navigation', ($location) ->
$location.path("/")
else
$location.path(@path)
go: (path)->
window.location.pathname = path

View File

@@ -19,7 +19,7 @@
%a{"bo-href" => "hub.path", "ng-show" => "!emptiesCart()"}
Shop at
%strong {{ hub.name }}
%a{"bo-href" => "hub.path", "ng-show" => "emptiesCart()"}
%a{"ng-click" => "changeHub()", "ng-show" => "emptiesCart()"}
Change hub to
%strong {{ hub.name }}