doAction( “before_hide_area” )

doAction( "before_hide_area", area, hideAreas );
doAction( "before_hide_area_{key}", area, hideAreas );

Fires before an Area is hidden. The second parameter notifies the callback about Areas that will also be hidden together with this Area.

The dynamic part of the filter name is the sanitized Area key. See DiviAreaItem.theKey() for details.

Params

area DiviAreaItem, required
The Area which will be hidden.
hideAreas array, required
List of Area IDs that will be hidden before the current Area is hidden.

Examples

// Save a Cookie/localStorage detail when an Area is closed.
DiviArea.addAction( 'before_hide_area', function( area, hideIds ) {
    var key = area.getKey() + '_state';
    DiviArea.Utils.setLocalData( key, 'closed' );
});

Notes

The hideAreas array is always empty, but you can manipulate it, if you want to hide/not hide certain Areas before the new Area is opened. It’s present in the action for consistency with the before_show_area action.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Get in touch with us