Sha256: c3f0a43906994145ba5ac125b69504e3dc03ffa92447d6fe75b29544ec393661

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

if ($('.ui.modals').length === 0) {
  $('body').append('<%= j(render 'edit') %>');
} else {
  $('.ui.modals').html('<%= j(render 'edit') %>');
}

$('.ui.modal').modal('setting', { autofocus: false }).modal('show');

$('#address_nation').dropdown({
  onChange: function(value, text, $selectedItem){
    var search_path = '/areas/search'
    var search_url = new URL(window.location.origin + search_path)
    search_url.searchParams.set('nation', value)
    fetch(search_url).then(function(response){
      return response.json();
    }).then(function(response){
      $('#address_province').dropdown('clear').dropdown('setup menu', response);
    })
  }
});

$('#address_province').dropdown({
  onChange: function(value, text, $selectedItem){
    var search_path = '/areas/search'
    var search_url = new URL(window.location.origin + search_path)
    search_url.searchParams.set('province', value)
    fetch(search_url).then(function(response){
      return response.json();
    }).then(function(response){
      $('#address_city').dropdown('clear').dropdown('setup menu', response);
    })
  }
});

$('#address_city').dropdown({
  onChange: function(value, text, $selectedItem){
    $('#address_area_id').val(value);
  }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_trade-0.0.1 app/views/rails_trade_admin/addresses/edit.js.erb