mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[soc2009/admin-ui] Omitting an extra comma at the end of the ID list for M2M autocomplete
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/admin-ui@11428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c4dd344a9b
commit
ed30463b6c
@ -25,11 +25,16 @@ $(document).ready(function() {
|
||||
'model_name': '{{ model_name }}'
|
||||
},
|
||||
multiple: true,
|
||||
mustMatch: true,
|
||||
autoFill: true
|
||||
mustMatch: true
|
||||
}).result(function(event, data, formatted) {
|
||||
if (data) {
|
||||
$('#id_{{ name }}').val($('#id_{{ name }}').val() + data[1] + ",");
|
||||
if ($('#id_{{ name }}').val()) {
|
||||
$('#id_{{ name }}').val($('#id_{{ name }}').val() + "," + data[1]);
|
||||
}
|
||||
else {
|
||||
$('#id_{{ name }}').val(data[1]);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user