From ffb21cfc49d1a4ec1a39ef359e704771b08f1cf2 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 8 Apr 2014 15:10:30 +1000 Subject: [PATCH] Fixing a scoping issue --- .../darkswarm/controllers/checkout_controller.js.coffee | 2 ++ app/views/shop/checkout/_authentication.html.haml | 5 ++--- app/views/shop/checkout/edit.html.haml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/checkout_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/checkout_controller.js.coffee index db944ab955..aa34740744 100644 --- a/app/assets/javascripts/darkswarm/controllers/checkout_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/checkout_controller.js.coffee @@ -4,6 +4,8 @@ Darkswarm.controller "CheckoutCtrl", ($scope, Order, storage) -> storage.bind $scope, "user", { defaultValue: true} $scope.disable = -> $scope.user = false + $scope.details = true + console.log $scope.details storage.bind $scope, "details" storage.bind $scope, "billing" diff --git a/app/views/shop/checkout/_authentication.html.haml b/app/views/shop/checkout/_authentication.html.haml index 5c0385d6ce..2b81b9383e 100644 --- a/app/views/shop/checkout/_authentication.html.haml +++ b/app/views/shop/checkout/_authentication.html.haml @@ -1,13 +1,12 @@ -%fieldset{"ng-controller" => "CheckoutCtrl"} +%fieldset %accordion-group{heading: "User", "is-open" => "user"} .row .large-12.columns - .div{"ng-controller" => "AuthenticationActionsCtrl"} + .span{"ng-controller" => "AuthenticationActionsCtrl"} %button{"ng-click" => "toggle('/login')"} Login %button{"ng-click" => "toggle('/signup')"} Signup %button{"ng-click" => "disable()"} Checkout as guest - -#%section#checkout_login -#.large-6.columns -#= render partial: "shop/checkout/login" diff --git a/app/views/shop/checkout/edit.html.haml b/app/views/shop/checkout/edit.html.haml index 03f76703bb..2fb957c46a 100644 --- a/app/views/shop/checkout/edit.html.haml +++ b/app/views/shop/checkout/edit.html.haml @@ -6,8 +6,8 @@ = render partial: "shop/details" - %checkout{"ng-controller" => "CheckoutCtrl"} - %accordion.row{"close-others" => "false"} + %accordion.row{"close-others" => "false"} + %checkout{"ng-controller" => "CheckoutCtrl"} .large-9.columns - unless spree_current_user = render partial: "shop/checkout/authentication"