diff --git a/app/assets/javascripts/darkswarm/controllers/shopping_tabs_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/shopping_tabs_controller.js.coffee index 8daac0212c..b99d169c5b 100644 --- a/app/assets/javascripts/darkswarm/controllers/shopping_tabs_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/shopping_tabs_controller.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.controller "ShoppingTabsCtrl", ($scope, $controller, Navigation) -> +Darkswarm.controller "ShoppingTabsCtrl", ($scope, $controller, Navigation, $location) -> angular.extend this, $controller('TabsCtrl', {$scope: $scope}) $scope.tabs = @@ -6,3 +6,7 @@ Darkswarm.controller "ShoppingTabsCtrl", ($scope, $controller, Navigation) -> producers: { active: Navigation.isActive('/producers') } contact: { active: Navigation.isActive('/contact') } groups: { active: Navigation.isActive('/groups') } + + $scope.$on '$locationChangeStart', (event, url) -> + tab = $location.path().replace(/^\//, '') + $scope.tabs[tab]?.active = true diff --git a/app/views/shop/_messages.html.haml b/app/views/shop/_messages.html.haml index 9e5d3b8e82..8debaff82e 100644 --- a/app/views/shop/_messages.html.haml +++ b/app/views/shop/_messages.html.haml @@ -10,7 +10,7 @@ register: ('' + t('.register') + '').html_safe} - else = t '.require_customer_html', - {contact: ('' + t('.contact') + '').html_safe, + {contact: link_to(t('.contact'), '#contact'), enterprise: current_distributor.name} - elsif @order_cycles and @order_cycles.empty? - if current_distributor.preferred_shopfront_closed_message.present?