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

Need Support?

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