mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Make onchange code simpler
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
%div{class: "field"}
|
||||
= f.label :country_id, Spree.t(:country) + ':'
|
||||
%span{id: "#{s_or_b}country"}
|
||||
= f.collection_select :country_id, available_countries, :id, :name, {}, {class: 'select2 fullwidth'}
|
||||
= f.collection_select :country_id, available_countries, :id, :name, {}, {class: 'select2 fullwidth', onchange: "update_state('#{s_or_b}')"}
|
||||
%div{class: "field"}
|
||||
= f.label :state_id, Spree.t(:state) + ':'
|
||||
%span{id: "#{s_or_b}state"}
|
||||
@@ -46,9 +46,3 @@
|
||||
%div{class: "field"}
|
||||
= f.label :phone, Spree.t(:phone) + ':'
|
||||
= f.phone_field :phone, class: 'fullwidth'
|
||||
|
||||
- content_for :head do
|
||||
= javascript_tag do
|
||||
$(document).ready(function(){
|
||||
$('span##{s_or_b}country .select2').on('change', function() { update_state('#{s_or_b}'); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user