fix previous

remotes/origin/yandex
Bachurin Sergey 12 years ago
parent fc9dfad759
commit 6c67c8c028
  1. 13
      project/static/js/dialogs.js

@ -25,18 +25,11 @@ $(document).ready(function() {
if (data.success) { if (data.success) {
if (form[0].id == 'client-edit-form') { if (form[0].id == 'client-edit-form') {
var autocomplete = $('#id_client_text').yourlabsAutocomplete();
$('#id_client_text').val(data.name); $('#id_client_text').val(data.name);
var choices = autocomplete.box.find(autocomplete.choiceSelector); $('#id_client_text').hide()
autocomplete.refresh(); $('#id_client-deck').html('<span class="div hilight" data-value='+ data.id +'><span class="remove div" style="display: inline;">X</span>' + data.name + '</span>');
autocomplete.show = function(html) {
yourlabs.Autocomplete.prototype.show.call(this, html)
var choices = this.box.find(this.choiceSelector);
if (choices.length == 1) { $('#id_client').html('<option selected="selected" value="'+ data.id +'"></option>');
this.input.trigger('selectChoice', [choices, this]);
}
}
} }
form.dialog('close'); form.dialog('close');
form.clearForm(); form.clearForm();

Loading…
Cancel
Save