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
- 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()
)