fix previous

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

@ -25,18 +25,11 @@ $(document).ready(function() {
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]);
}
}
$('#id_client_text').hide()
$('#id_client-deck').html('<span class="div hilight" data-value='+ data.id +'><span class="remove div" style="display: inline;">X</span>' + data.name + '</span>');
$('#id_client').html('<option selected="selected" value="'+ data.id +'"></option>');
}
form.dialog('close');
form.clearForm();

Loading…
Cancel
Save