1( function () { 2 'use strict'; 3 4 document.addEventListener( 'DOMContentLoaded', function () { 5 6 // --- Mobile accordion --- 7 8 document.querySelectorAll( '.cpm__acc-trigger' ).forEach( function ( trigger ) { 9 trigger.addEventListener( 'click', function () { 10 var item = trigger.closest( '.cpm__acc-item' ); 11 var body = item.querySelector( '.cpm__acc-body' ); 12 var isOpen = item.classList.contains( 'is-open' ); 13 14 // Close all open items in this accordion. 15 var accordion = trigger.closest( '.cpm__accordion' ); 16 accordion.querySelectorAll( '.cpm__acc-item.is-open' ).forEach( function ( openItem ) { 17 openItem.classList.remove( 'is-open' ); 18 openItem.querySelector( '.cpm__acc-trigger' ).setAttribute( 'aria-expanded', 'false' ); 19 openItem.querySelector( '.cpm__acc-body' ).hidden = true; 20 } ); 21 22 // Open this item if it was closed. 23 if ( ! isOpen ) { 24 item.classList.add( 'is-open' ); 25 trigger.setAttribute( 'aria-expanded', 'true' ); 26 body.hidden = false; 27 } 28 } ); 29 } ); 30 31 // --- Desktop column highlight --- 32 33 document.querySelectorAll( '.cpm__table' ).forEach( function ( table ) { 34 // Map cellIndex â data-hover-col value (skip column 0, the capability area). 35 table.addEventListener( 'mouseover', function ( e ) { 36 var cell = e.target.closest( 'td, th' ); 37 if ( ! cell ) return; 38 var idx = cell.cellIndex; 39 if ( idx > 0 ) { 40 table.dataset.hoverCol = idx; 41 } else { 42 delete table.dataset.hoverCol; 43 } 44 } ); 45 46 table.addEventListener( 'mouseleave', function () { 47 delete table.dataset.hoverCol; 48 } ); 49 } ); 50 51 } ); 52} )();
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.