From 92eca72f4f03fe58e429db027da031fb30a43390 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 6 Jun 2014 13:57:32 +1000 Subject: [PATCH] Fixing a couple of paths and clearing localStorage when changing distributor --- .../javascripts/darkswarm/directives/empties_cart.js.coffee | 3 ++- app/views/shared/menu/_large_menu.html.haml | 2 +- app/views/shared/menu/_mobile_menu.html.haml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee b/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee index b2e93b5c9b..64940d15e2 100644 --- a/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation) -> +Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation, storage) -> restrict: "A" scope: hub: '=ofnEmptiesCart' @@ -10,6 +10,7 @@ Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation) -> elm.bind 'click', (ev)-> ev.preventDefault() if confirm "Are you sure? This will change your selected Hub and remove any items in you shopping cart." + storage.clearAll() Navigation.go scope.hub.path else scope.action = attr.shop diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 63b4a55928..c85516d8c3 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -13,7 +13,7 @@ %span.nav-primary Hubs %li.divider %li - %a{href: map_path} + %a{href: main_app.map_path} %span.nav-primary Map %li.divider %li diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index e038c19eaf..22e65030b0 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -36,7 +36,7 @@ %i.ofn-i_040-hub Hubs %li - %a{href: ""} + %a{href: main_app.map_path} %span.nav-primary %i.ofn-i_037-map Map