doAction( “refresh_area” )

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

Fires after options were applied to the area DOM elements.

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

Params

area
(DiviAreaItem) The updated area object

Examples

// Add a custom class to the area wrapper.
DiviArea.addAction( 'refesh_area', function( area ) {
    if ( area.getData( 'custom-value' ) ) {
        area.addClass( 'custom-class' );
    } else {
        area.removeClass( 'custom-class' );
    }
});

Notes

This action will be called with a slight delay (about 20 milliseconds) after calling area.setData().

Was this article helpful?

Related Articles