Fix bug #392 "Inline model admin: wrong hiding of add button"
parent
622e1e780b
commit
11208cedf8
|
|
@ -128,7 +128,7 @@
|
||||||
nextIndex += 1;
|
nextIndex += 1;
|
||||||
// Hide add button in case we've hit the max, except we want to add infinitely
|
// Hide add button in case we've hit the max, except we want to add infinitely
|
||||||
if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) {
|
if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) {
|
||||||
addButtons.parent().hide();
|
addContainer.hide();
|
||||||
}
|
}
|
||||||
// The delete button of each row triggers a bunch of other things
|
// The delete button of each row triggers a bunch of other things
|
||||||
row.find("a." + options.deleteCssClass).click(function(e1) {
|
row.find("a." + options.deleteCssClass).click(function(e1) {
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
$("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length);
|
$("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length);
|
||||||
// Show add button again once we drop below max
|
// Show add button again once we drop below max
|
||||||
if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) {
|
if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) {
|
||||||
addButtons.parent().show();
|
addContainer.show();
|
||||||
}
|
}
|
||||||
// Also, update names and ids for all remaining form controls
|
// Also, update names and ids for all remaining form controls
|
||||||
// so they remain in sequence:
|
// so they remain in sequence:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue