Permalink
Browse files

Fixed #13459 -- Corrected ID numbering of dynamically added inlines i…

…n the admin. Thanks to 3point2 for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 28294b3 commit cb02b92f854d08f17f93255001f0fdaf8ab8c29e @freakboy3742 freakboy3742 committed May 2, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 django/contrib/admin/media/js/inlines.js
  2. +2 −2 django/contrib/admin/media/js/inlines.min.js
@@ -53,7 +53,7 @@
}
addButton.click(function() {
var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS");
- var nextIndex = parseInt(totalForms.val());
+ var nextIndex = parseInt(totalForms.val()) + 1;
var template = $("#" + options.prefix + "-empty");
var row = template.clone(true);
row.removeClass(options.emptyCssClass)
@@ -93,7 +93,7 @@
updateElementIndex(this, options.prefix, totalForms.val());
});
// Update number of total forms
- $(totalForms).val(nextIndex + 1);
+ $(totalForms).val(nextIndex);
// Hide add button in case we've hit the max, except we want to add infinitely
if ((maxForms.val() != '') && (maxForms.val() <= totalForms.val())) {
addButton.parent().hide();

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit cb02b92

Please sign in to comment.