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

@@ -5,7 +5,7 @@
#
#= require angular
#= require angular-resource
#= require mm-foundation-tpls-0.1.0.min.js
#= require ../shared/mm-foundation-tpls-0.2.0-SNAPSHOT
#
#= require ../shared/jquery.timeago
#= require foundation

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

View File

@@ -2,4 +2,3 @@ window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.fou
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
$httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest'
$httpProvider.defaults.headers.common.Accept = "application/json, text/javascript, */*"

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,6 @@
contact: "Contact"}
%tab{heading: heading,
active: "#{name}.active",
active: "active(#{name}.path)",
select: "select(#{name})"}
= render "shop/shop/#{name}"