Permalink
Browse files

Fixed #14830 -- Ensure that radio buttons on inlines preserve their d…

…efault value. Thanks to Julien Phalip for the report and patch, and to antoinemartin for the diagnosis.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15420 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7a60b41 commit baef1cfbbc5eb61ae140ef11128e11f804a45369 @freakboy3742 freakboy3742 committed Feb 5, 2011
Showing with 8 additions and 7 deletions.
  1. +3 −2 django/contrib/admin/media/js/inlines.js
  2. +5 −5 django/contrib/admin/media/js/inlines.min.js
@@ -58,8 +58,7 @@
var row = template.clone(true);
row.removeClass(options.emptyCssClass)
.addClass(options.formCssClass)
- .attr("id", options.prefix + "-" + nextIndex)
- .insertBefore($(template));
+ .attr("id", options.prefix + "-" + nextIndex);
row.find("*")
.filter(function() {
var el = $(this);
@@ -92,6 +91,8 @@
row.find("input,select,textarea,label,a").each(function() {
updateElementIndex(this, options.prefix, totalForms.val());
});
+ // Insert the new form when it has been fully edited
+ row.insertBefore($(template));
// Update number of total forms
$(totalForms).val(nextIndex + 1);
// Hide add button in case we've hit the max, except we want to add infinitely
Oops, something went wrong.

0 comments on commit baef1cf

Please sign in to comment.