Ticket #15569: fix-nextindex-update.patch

File fix-nextindex-update.patch, 823 bytes (added by Arthur de Jong <arthur@…>, 13 years ago)

alternate fix

  • Django-1.3-rc-1/django/contrib/admin/media/js/inlines.js

    old new  
    5959                                row.removeClass(options.emptyCssClass)
    6060                                    .addClass(options.formCssClass)
    6161                                    .attr("id", options.prefix + "-" + nextIndex);
    62                                 nextIndex += 1;
    6362                                row.find("*")
    6463                                    .filter(function() {
    6564                                        var el = $(this);
     
    104103                                row.insertBefore($(template));
    105104                                // Update number of total forms
    106105                                $(totalForms).val(parseInt(totalForms.val()) + 1);
     106                                nextIndex += 1;
    107107                                // Hide add button in case we've hit the max, except we want to add infinitely
    108108                                if ((maxForms.val() != '') && (maxForms.val()-totalForms.val()) <= 0) {
    109109                                        addButton.parent().hide();
Back to Top