new: add persistence of default address selection
This commit is contained in:
@@ -70,10 +70,18 @@
|
||||
$formContainer.addClass('d-none');
|
||||
$formContainer.find('input[type="text"]').val('');
|
||||
if (response.id) {
|
||||
$list.find('#address_' + response.id).prop('checked', true);
|
||||
const $newRadio = $list.find('#address_' + response.id);
|
||||
$list.find('input[type="radio"]').not($newRadio).prop('checked', false);
|
||||
$newRadio.prop('checked', true);
|
||||
}
|
||||
if (typeof initIcheck === 'function') {
|
||||
initIcheck('#addresses_list_{{ $prefix }} input[type="radio"]');
|
||||
if (typeof $.fn.iCheck === 'function') {
|
||||
$list.find('input[type="radio"]').iCheck('destroy');
|
||||
if (typeof initIcheck === 'function') {
|
||||
initIcheck('#addresses_list_{{ $prefix }} input[type="radio"]');
|
||||
if (response.id) {
|
||||
$list.find('#address_' + response.id).iCheck('check');
|
||||
}
|
||||
}
|
||||
}
|
||||
const message = response.message || '{{ __('Adresse enregistrée.') }}';
|
||||
if (typeof growl === 'function') {
|
||||
|
||||
Reference in New Issue
Block a user