Manually bringing over the login links for checkout

This commit is contained in:
Will Marshall
2014-04-11 12:37:32 +10:00
parent cf3681b934
commit 33cf05ab83
8 changed files with 186 additions and 19 deletions

View File

@@ -4,8 +4,10 @@
#= require spin
#
#= require angular
#= require angular-cookies
#= require angular-resource
#= require ../shared/mm-foundation-tpls-0.2.0-SNAPSHOT
#= require ../shared/angular-local-storage.js
#
#= require ../shared/jquery.timeago
#= require foundation

View File

@@ -1,6 +1,7 @@
Darkswarm.controller "CheckoutCtrl", ($scope, $rootScope, order) ->
Darkswarm.controller "CheckoutCtrl", ($scope, $rootScope, order, $location, $anchorScroll) ->
$scope.require_ship_address = false
$scope.order = order
$scope.userOpen = true
$scope.initialize = ->
# Our shipping_methods comes through as a hash like so: {id: requires_shipping_address}
@@ -25,5 +26,10 @@ Darkswarm.controller "CheckoutCtrl", ($scope, $rootScope, order) ->
event.preventDefault()
checkout.submit()
$scope.scrollTo = (name)->
$location.hash(name);
$anchorScroll();
$scope.userOpen = false
$scope.initialize()

View File

@@ -1,13 +0,0 @@
window.MenuCtrl = Darkswarm.controller "MenuCtrl", ($scope, Navigation) ->
$scope.toggleLogin = ->
Navigation.navigate "/login"
$scope.toggleSignup = ->
Navigation.navigate "/signup"
$scope.toggleSignup = ->
Navigation.navigate "/signup"
$scope.toggle = (path = null)->
Navigation.navigate(path)

View File

@@ -1,5 +1,6 @@
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation']).config ($httpProvider, $tooltipProvider) ->
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation', 'angularLocalStorage']).config ($httpProvider, $tooltipProvider) ->
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
$httpProvider.defaults.headers.put['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, */*"