|
|
|
|
@ -14,13 +14,30 @@ $(document).ready(function() { |
|
|
|
|
complete: function(data) { |
|
|
|
|
$('input', form).removeAttr('disabled'); |
|
|
|
|
$('button', form).removeAttr('disabled'); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/*beforeSend: function() { |
|
|
|
|
$('.errors-layout', form).html('').hide(); |
|
|
|
|
},*/ |
|
|
|
|
success: function(data) { |
|
|
|
|
clear_form_errors(form); |
|
|
|
|
|
|
|
|
|
if (data.success) { |
|
|
|
|
if (form[0].id == 'client-edit-form') { |
|
|
|
|
var autocomplete = $('#id_client_text').yourlabsAutocomplete(); |
|
|
|
|
$('#id_client_text').val(data.name); |
|
|
|
|
var choices = autocomplete.box.find(autocomplete.choiceSelector); |
|
|
|
|
autocomplete.refresh(); |
|
|
|
|
autocomplete.show = function(html) { |
|
|
|
|
yourlabs.Autocomplete.prototype.show.call(this, html) |
|
|
|
|
var choices = this.box.find(this.choiceSelector); |
|
|
|
|
|
|
|
|
|
if (choices.length == 1) { |
|
|
|
|
this.input.trigger('selectChoice', [choices, this]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
form.dialog('close'); |
|
|
|
|
form.clearForm(); |
|
|
|
|
if (data.message) { |
|
|
|
|
|