applyFilters( “reorder_areas” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Filters
  6. applyFilters( “reorder_areas” )
applyFilters( "reorder_areas", zIndexList );

Filters the z-index values of all visible areas and the overlay modal.

Examples

// Example of zIndexList
console.log( zIndexList );

> {
>    "#popup-1", 10000,
>    "#popup-2", 10002,
>    "overlay", 10001
> }

// Force the overlay behind all Popups (not behind the top-most popup).
DiviArea.applyFilters( 'reorder_areas', function( zIndexList ) {
    if ( zIndexList.overlay ) {
        // Move the overlay behind the first area.
        zIndexList.overlay = DiviArea.Utils.getOption('zIndex') - 1;
    }
    return zIndexList;
});

Notes

This filter is called before the filter "apply_z_index"

When a z-index value is set to 0/false/undefined, that Area will not be modified and keep its current z-index position.

The zIndexList object does not contain inline Areas. However, you can add Inline Area IDs to the return value if you want to set their z-index value.

Was this article helpful?

Related Articles