doAction( “before_hide_area” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Actions
  6. doAction( “before_hide_area” )
DiviArea.doAction( 'before_hide_area', area, hideIds );
DiviArea.doAction( 'before_hide_area_{id}', area, hideIds );

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

The {id} part in the hook name is the sanitized area-ID (all lower case, dashes changed to underscores).

Params

area
(DiviAreaItem) The Area which will be hidden.
hideIds
(array) 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

No notes.

Was this article helpful?

Related Articles