mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix the toggle address confirmed checkbox so the latitude/longitude gets set
Before when you checked and unchecked the checkbox it was toggling the :isConfirmed variable.
This commit is contained in:
@@ -4,7 +4,7 @@ Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, Enterpris
|
||||
$scope.select = RegistrationService.select
|
||||
$scope.geocodedAddress = ''
|
||||
$scope.latLong = null
|
||||
$scope.addressConfirmed
|
||||
$scope.addressConfirmed = false
|
||||
$scope.steps = ['details', 'contact', 'type', 'about', 'images', 'social']
|
||||
|
||||
# Filter countries without states since the form requires a state to be selected.
|
||||
@@ -39,9 +39,9 @@ Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, Enterpris
|
||||
$scope.map = {center: {latitude: location.lat(), longitude: location.lng()}, zoom: 16 }
|
||||
)
|
||||
|
||||
$scope.confirmAddressChange = (isConfirmed) ->
|
||||
$scope.addressConfirmed = isConfirmed
|
||||
if isConfirmed
|
||||
$scope.toggleAddressConfirmed = ->
|
||||
$scope.addressConfirmed = !$scope.addressConfirmed
|
||||
if $scope.addressConfirmed
|
||||
$scope.enterprise.address.latitude = $scope.latLong.latitude
|
||||
$scope.enterprise.address.longitude = $scope.latLong.longitude
|
||||
else
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
%input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } }
|
||||
.center{ ng: {if: "latLong"}}
|
||||
.field
|
||||
%input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { model: 'addressConfirmed', change: 'confirmAddressChange(confirmAddress)'} }
|
||||
%input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { click: 'toggleAddressConfirmed()' } }
|
||||
%label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}}
|
||||
.small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}}
|
||||
.field
|
||||
|
||||
Reference in New Issue
Block a user