mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
43 lines
947 B
CoffeeScript
43 lines
947 B
CoffeeScript
$ ->
|
|
($ '#country_based').click ->
|
|
show_country()
|
|
|
|
($ '#state_based').click ->
|
|
show_state()
|
|
|
|
if ($ '#country_based').is(':checked')
|
|
show_country()
|
|
else if ($ '#state_based').is(':checked')
|
|
show_state()
|
|
else
|
|
show_state()
|
|
($ '#state_based').click()
|
|
|
|
|
|
show_country = ->
|
|
($ '#state_members :input').each ->
|
|
($ this).prop 'disabled', true
|
|
|
|
($ '#state_members').hide()
|
|
($ '#zone_members :input').each ->
|
|
($ this).prop 'disabled', true
|
|
|
|
($ '#zone_members').hide()
|
|
($ '#country_members :input').each ->
|
|
($ this).prop 'disabled', false
|
|
|
|
($ '#country_members').show()
|
|
|
|
show_state = ->
|
|
($ '#country_members :input').each ->
|
|
($ this).prop 'disabled', true
|
|
|
|
($ '#country_members').hide()
|
|
($ '#zone_members :input').each ->
|
|
($ this).prop 'disabled', true
|
|
|
|
($ '#zone_members').hide()
|
|
($ '#state_members :input').each ->
|
|
($ this).prop 'disabled', false
|
|
|
|
($ '#state_members').show() |