[DEV-3192] Fix hiding the header when all contents are hidden
parent
8ac2a367db
commit
345e570e67
|
@ -792,7 +792,7 @@ module.exports = Class( 'GroupUi' )
|
|||
},
|
||||
|
||||
|
||||
'public hideField': function( field, index )
|
||||
'virtual public hideField': function( field, index )
|
||||
{
|
||||
if ( this.isFieldVisible( field, index ) === false )
|
||||
{
|
||||
|
@ -814,7 +814,13 @@ module.exports = Class( 'GroupUi' )
|
|||
},
|
||||
|
||||
|
||||
'public showField': function( field, index )
|
||||
'protected hasVisibleField'( index )
|
||||
{
|
||||
return this._visCount[ index ] > 0 ? true : false;
|
||||
},
|
||||
|
||||
|
||||
'virtual public showField': function( field, index )
|
||||
{
|
||||
if ( this.isFieldVisible( field, index ) === true )
|
||||
{
|
||||
|
|
|
@ -100,4 +100,49 @@ module.exports = Class( 'StackedGroupUi' )
|
|||
|
||||
return this.__super( index );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Hide the header if there are no visible fields
|
||||
*
|
||||
* @param field
|
||||
* @param index
|
||||
*/
|
||||
'public override hideField'( field, index )
|
||||
{
|
||||
this.__super( field, index );
|
||||
|
||||
if ( !this.hasVisibleField( index ) )
|
||||
{
|
||||
const header = this._$container.find( 'dl' )[ index ];
|
||||
var attribute = header.getAttribute( 'class' );
|
||||
|
||||
attribute = attribute.includes( ' hidden ' ) ? attribute : attribute + ' hidden ';
|
||||
|
||||
header.setAttribute( 'class', attribute );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Show the header if there are visible fields
|
||||
*
|
||||
* @param field
|
||||
* @param index
|
||||
*/
|
||||
'public override showField'( field, index )
|
||||
{
|
||||
this.__super( field, index );
|
||||
|
||||
if ( this.hasVisibleField( index ) )
|
||||
{
|
||||
const header = this._$container.find( 'dl' )[ index ];
|
||||
var attribute = header.getAttribute( 'class' );
|
||||
|
||||
attribute = attribute.includes( ' hidden ' ) ? attribute.replace(' hidden ', '') : attribute;
|
||||
|
||||
header.setAttribute( 'class', attribute );
|
||||
}
|
||||
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue