doAction( “refresh_area” )

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

Fires after options were applied to the area DOM elements.

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

Params

area
(DiviAreaItem, required) 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