kopia lustrzana https://github.com/wagtail/wagtail
Fixing issue with inline panels used in non-content panels failing to display correctly due to use of :visible, which doesn't work as expected when content is already hidden at runtime
rodzic
31cfabc275
commit
70d263ce6e
|
@ -122,9 +122,12 @@ function InlinePanel(opts) {
|
|||
var self = {};
|
||||
|
||||
self.setHasContent = function(){
|
||||
if($('li:visible', self.formsUl).length){
|
||||
if($('> li', self.formsUl).not(".deleted").length){
|
||||
console.log(self.formsUl)
|
||||
console.log('here');
|
||||
self.formsUl.parent().removeClass('empty');
|
||||
}else{
|
||||
console.log('there');
|
||||
self.formsUl.parent().addClass('empty');
|
||||
}
|
||||
};
|
||||
|
@ -139,7 +142,7 @@ function InlinePanel(opts) {
|
|||
$('#' + deleteInputId + '-button').click(function() {
|
||||
/* set 'deleted' form field to true */
|
||||
$('#' + deleteInputId).val('1');
|
||||
$('#' + childId).slideUp(function() {
|
||||
$('#' + childId).addClass('deleted').slideUp(function() {
|
||||
self.updateMoveButtonDisabledStates();
|
||||
self.setHasContent();
|
||||
});
|
||||
|
@ -191,8 +194,8 @@ function InlinePanel(opts) {
|
|||
/* 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() {
|
||||
if ($('#' + deleteInputId).val() === "1" ) {
|
||||
$('#' + childId).addClass('deleted').hide(0, function() {
|
||||
self.updateMoveButtonDisabledStates();
|
||||
self.setHasContent();
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue