doAction( “hide_area” )

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

Fires, once a previously visible Area is hidden again.

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

Params

area
(DiviAreaItem) The Area object.

Examples

// Send an event to google analytics, once a Popup was closed.
DiviArea.addAction( 'hide_area', function( area ) {
    var type = area.getType();
    var key = area.getKey();

    if ( 'popup' === type ) {
        ga( 'send', 'event', 'Popup', 'close', key );
    }
});

Notes

The hide_area action fires after the blur_area, when the “clean-up” process has finished: All event handlers were removed from the Area and it was detached from the DOM tree.

Was this article helpful?

Related Articles