app/assets/javascripts/spree/frontend/checkout/address.js.coffee in solidus_frontend-1.0.7 vs app/assets/javascripts/spree/frontend/checkout/address.js.coffee in solidus_frontend-1.1.0.beta1
- old
+ new
@@ -1,10 +1,7 @@
$ ->
if $('#checkout_form_address').is('*')
- # Hidden by default to support browsers with javascript disabled
- $('.js-address-fields').show()
-
$('#checkout_form_address').validate()
getCountryId = (region) ->
$('#' + region + 'country select').val()
@@ -44,11 +41,15 @@
stateSelect.append opt
stateSelect.prop('disabled', false).show()
stateInput.hide().prop 'disabled', true
statePara.show()
- stateSpanRequired.show()
- stateSelect.addClass('required') if statesRequired
+ if statesRequired
+ stateSelect.addClass('required')
+ stateSpanRequired.show()
+ else
+ stateSelect.removeClass('required')
+ stateSpanRequired.hide()
stateSelect.removeClass('hidden')
stateInput.removeClass('required')
else
stateSelect.hide().prop 'disabled', true
stateInput.show()