1// Adaptive card reveal translation 2(function(){ 3 'use strict'; 4 5 function updateCardTranslate(card){ 6 if(!card) return; 7 var reveal = card.querySelector('.card-reveal-content'); 8 if(!reveal) return; 9 10 // Use scrollHeight which reports full content height even when collapsed 11 var height = reveal.scrollHeight || 0; 12 13 // Cap at 180px (can't move card body more than 180px) 14 var capped = Math.min(180, height); 15 16 // Translate needs to be negative px value 17 var translate = -Math.round(capped) + 'px'; 18 card.style.setProperty('--card-reveal-translate', translate); 19 } 20 21 function updateAll(){ 22 var cards = document.querySelectorAll('.card'); 23 cards.forEach(function(c){ updateCardTranslate(c); }); 24 } 25 26 document.addEventListener('DOMContentLoaded', function(){ 27 updateAll(); 28 29 // Recompute on window resize 30 window.addEventListener('resize', function(){ 31 // debounce 32 clearTimeout(window._cardRevealResizeTimeout); 33 window._cardRevealResizeTimeout = setTimeout(updateAll, 120); 34 }); 35 36 // Observe DOM changes that may affect reveal heights 37 var mo = new MutationObserver(function(){ updateAll(); }); 38 mo.observe(document.body, { childList: true, subtree: true, characterData: true }); 39 }); 40})();
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.