Permalink
Browse files

[1.2.X] Fixed #14830 -- Ensure that radio buttons on inlines preserve…

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

Backport of r15420 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15421 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 6987048 commit 4a3a97e5310339fafacaa308d7ac20c214c9d821 @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 4a3a97e

Please sign in to comment.