mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Always keep one shop tab open (don't toggle closed)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user