1(function ($, Drupal) { 2 3 4 5 const Diff = 'diff' 6 const DiffOpn = `${Diff}__open` 7 const DiffSctn = `${Diff}-section` 8 const DiffSctnActv = `${DiffSctn}__active` 9 const DiffCntrllr = `${Diff}-controller` 10 11 const DiffWidth = () => { 12 $('.diff').each((DiffIndx, DiffItm) => { 13 const DiffW = DiffItm.getBoundingClientRect().width 14 $(DiffItm).css("--diff-w", `${(Math.round(DiffW * 100) / 100)}px`) 15 }) 16 } 17 18 19 20 DiffWidth() 21 22 $(window).on( "resize", function() { 23 DiffWidth() 24 }) 25 26 $(document).on('click', `.${DiffSctn}`, function() { 27 let ClckdSctn = $(this) 28 let DiffRoot = ClckdSctn.closest(`.${Diff}`) 29 30 if(DiffRoot.length === 1) { 31 if(!ClckdSctn.hasClass(DiffSctnActv)) { 32 DiffRoot.addClass(DiffOpn) 33 DiffRoot.find(`.${DiffSctn}`).each((DiffSctnIndx, DiffSctnItm) => { 34 if(ClckdSctn[0] === DiffSctnItm) { 35 $(DiffSctnItm).addClass(DiffSctnActv) 36 } else { 37 $(DiffSctnItm).removeClass(DiffSctnActv) 38 } 39 }) 40 } else { 41 DiffRoot.removeClass(DiffOpn) 42 DiffRoot.find(`.${DiffSctn}`).each((DiffSctnIndx, DiffSctnItm) => { 43 $(DiffSctnItm).removeClass(DiffSctnActv) 44 }) 45 } 46 } 47 }) 48 49 50 51} (jQuery, Drupal));
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.