mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Making checkout accordion work with new local storage library
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user