diff --git a/app/assets/javascripts/darkswarm/directives/tabset_ctrl.js.coffee b/app/assets/javascripts/darkswarm/directives/tabset_ctrl.js.coffee index dd8d9a279b..21bedf4697 100644 --- a/app/assets/javascripts/darkswarm/directives/tabset_ctrl.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/tabset_ctrl.js.coffee @@ -5,13 +5,15 @@ Darkswarm.directive "tabsetCtrl", (Tabsets, $location) -> selected: "@" navigate: "=" prefix: "@?" + alwaysopen: "=" controller: ($scope, $element) -> if $scope.navigate path = $location.path()?.match(/^\/\w+$/)?[0] $scope.selected = path[1..] if path this.toggle = (name) -> - Tabsets.toggle($scope.id, name) + state = if $scope.alwaysopen then 'open' else null + Tabsets.toggle($scope.id, name, state) this.select = (selection) -> $scope.$broadcast("selection:changed", selection) diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index 8512844c32..16053bb267 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -2,7 +2,7 @@ - if tab[:show] = render "shopping_shared/tabs/#{tab[:name]}" -.tabset-ctrl#shop-tabs{ navigate: 'true', selected: first_visible_tab, prefix: 'shop', ng: { cloak: true } } +.tabset-ctrl#shop-tabs{ navigate: 'true', alwaysopen: 'true', selected: first_visible_tab, prefix: 'shop', ng: { cloak: true } } .tab-buttons .row - shop_tabs.each do |tab|