DiviArea.Data.countVisibleAreas()

DiviArea.Data.countVisibleAreas(filter)

Counts the number of visible Areas.

The filter is tested via DiviAreaItem.isType() to determine, which Areas to count.

Params

filter string, optional
A filter to limit Areas that are included in the callback loop.
Default: all

Returns

Number of currently visible Areas (integer).

Examples

// Count all visible Areas.
console.log( 'Visible Areas:', DiviArea.Data.countVisibleAreas() );

// Count all visible Popups.
console.log( 'Visible Popups:', DiviArea.Data.countVisibleAreas( 'popup' ) );

Notes

This method is used internally to determine, whether a Popup is visible or not. When no Popup is visible, the overlay is removed (via DiviArea.hideOverlay())

Was this article helpful?

Related Articles

Need Support?

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