mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Tidying up tabs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location, OrderCycle) ->
|
||||
$scope.active = (path)->
|
||||
if !OrderCycle.selected() and $location.hash() == "" and path == "/about"
|
||||
if !OrderCycle.selected() and $location.hash() == "" and path == "about"
|
||||
true
|
||||
else
|
||||
$location.hash() == path
|
||||
@@ -9,10 +9,10 @@ Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location, OrderCycle) ->
|
||||
$scope.tabs = ["contact", "about", "groups", "producers"]
|
||||
for tab in $scope.tabs
|
||||
$scope[tab] =
|
||||
path: "/" + tab
|
||||
path: tab
|
||||
|
||||
$scope.select = (tab)->
|
||||
if $scope.active(tab.path)
|
||||
$location.hash "/"
|
||||
$location.hash ""
|
||||
else
|
||||
$location.hash tab.path
|
||||
|
||||
Reference in New Issue
Block a user