Making checkout accordion work with new local storage library

This commit is contained in:
Rob Harrington
2016-10-07 13:03:21 +11:00
committed by Bing Xie
parent e57a25d05f
commit 3e56571e59

View File

@@ -1,11 +1,8 @@
Darkswarm.controller "AccordionCtrl", ($scope, localStorageService, $timeout, $document, CurrentHub) ->
$scope.accordion =
details: true
billing: false
shipping: false
payment: false
key = "accordion_#{$scope.order.id}#{CurrentHub.hub.id}#{$scope.order.user_id}"
value = if localStorageService.get(key) then {} else { details: true, billing: false, shipping: false, payment: false }
localStorageService.bind $scope, "accordion", value, key
$scope.accordionSections = ["details", "billing", "shipping", "payment"]
localStorageService.bind $scope, "accordion", $scope.accordion, "accordion_#{$scope.order.id}#{CurrentHub.hub.id}#{$scope.order.user_id}"
$scope.show = (section)->
$scope.accordion[section] = true