Fix #94. Panels are now hidden on page load if they are marked as

deleted after a form validation failure.
stable/0.3.x
Tom Talbot 2014-05-29 15:02:56 +01:00 zatwierdzone przez Matt Westcott
rodzic 2d7a276b83
commit a5072c768d
2 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -181,6 +181,17 @@ function InlinePanel(opts) {
self.updateMoveButtonDisabledStates();
});
}
/* Hide container on page load if it is marked as deleted. Remove the error
message so that it doesn't count towards the number of errors on the tab at the
top of the page. */
if ( $('#' + deleteInputId).val() === "1" ) {
$('#' + childId).hide(0, function() {
self.updateMoveButtonDisabledStates();
self.setHasContent();
});
$('#' + childId).find(".error-message").remove();
}
};
self.formsUl = $('#' + opts.formsetPrefix + '-FORMS');

Wyświetl plik

@ -5,7 +5,7 @@ from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.decorators import permission_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from wagtail.wagtailadmin.edit_handlers import TabbedInterface, ObjectList