PageSourceSearch

https://www.constructionbusinessowner.com/wp-content/plugins/cmg-b…/blocks/digital-partners/view.js?ver=1.0.0

js constructionbusinessowner.com collected 2026-10-02 03:41:13 UTC 909 bytes, 24 lines download raw bytes

1/**
2 * Digital Partners: collapse empty cells.
3 *
4 * The block renders up to 10 cells, each holding the same Advanced Ads / GAM
5 * shortcode. GAM fills as many as it has creatives for; the rest come back
6 * empty. The advanced-ads-gam plugin dispatches `aagam_empty_slot` (with the
7 * slot's div id in `detail`) for every unfilled slot — we listen for that and
8 * remove the enclosing cell so the grid reflows to only the available ads.
9 *
10 * We remove() rather than hide so the grid's `:last-child:nth-child(odd)`
11 * centering rule recomputes against the visible cells only.
12 */
13( function () {
14	document.addEventListener( 'aagam_empty_slot', function ( ev ) {
15		const slot = document.getElementById( ev.detail );
16		if ( ! slot ) {
17			return;
18		}
19		const cell = slot.closest( '.cmg-dp__cell' );
20		if ( cell && cell.closest( '.cmg-dp__grid[data-cmg-dp-dynamic="1"]' ) ) {
21			cell.remove();
22		}
23	} );
24} )();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.