mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Popup dialog when changing hub:
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -9,3 +9,6 @@ Darkswarm.factory 'Navigation', ($location) ->
|
||||
$location.path("/")
|
||||
else
|
||||
$location.path(@path)
|
||||
|
||||
go: (path)->
|
||||
window.location.pathname = path
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user