Temporary working version with hacked Foundation/Angular/Tabs

This commit is contained in:
Will Marshall
2014-03-26 16:44:48 +11:00
parent f5a0341851
commit cdfaf4fc92
5 changed files with 2624 additions and 15 deletions

View File

@@ -1,23 +1,18 @@
Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location) ->
$scope.active = (tab)->
$location.path() == tab
$scope.active = (path)->
$location.path() == path
$scope.tabs = ["contact", "about", "groups", "producers"]
for tab in $scope.tabs
$scope[tab] =
active: false #$scope.active("/" + tab)
path: "/" + tab
$scope.$watch ->
$location.path()
, (path)->
for tab in $scope.tabs
$scope[tab].active = $scope.active($scope[tab].path)
$scope.select = (tab)->
if $scope.active(tab.path)
$location.path "/"
else
$location.path tab.path
#$scope.select = (tab)->
#$location.path tab.path
#
#
# directive -> ng-click -> scope method (not isolated) -> toggle active | change location
# watch active expression -> change tab appearance