@microsoft/atlas-js
Advanced tools
Comparing version 1.13.0 to 1.13.1
@@ -14,3 +14,3 @@ let frame; | ||
const footerY = footer?.getBoundingClientRect().y || 0; // determine if header and footer are visible, assign visible heights as well | ||
const visibleFooterHeight = Math.round(Math.max(0, footerY + footerHeight)); | ||
const visibleFooterHeight = Math.round(footerY < window.innerHeight ? Math.min(window.innerHeight - footerY, footerHeight) : 0); | ||
const visibleFooterCssProp = `${visibleFooterHeight}px`; | ||
@@ -33,2 +33,6 @@ root.style.setProperty('--window-inner-height', `${window.innerHeight}px`, 'important'); | ||
window.addEventListener('DOMContentLoaded', setLayoutCssVariables, { passive: true }); | ||
// determine if header/footer are visible below the top of the viewport | ||
window.addEventListener('scroll', () => window.dispatchEvent(new CustomEvent('atlas-layout-change-event')), { | ||
passive: true | ||
}); | ||
} |
{ | ||
"name": "@microsoft/atlas-js", | ||
"version": "1.13.0", | ||
"version": "1.13.1", | ||
"public": true, | ||
@@ -5,0 +5,0 @@ "description": "Scripts backing the Atlas Design System used by Microsoft's Developer Relations.", |
@@ -17,3 +17,6 @@ let frame: number; | ||
const footerY = footer?.getBoundingClientRect().y || 0; // determine if header and footer are visible, assign visible heights as well | ||
const visibleFooterHeight = Math.round(Math.max(0, footerY + footerHeight)); | ||
const visibleFooterHeight = Math.round( | ||
footerY < window.innerHeight ? Math.min(window.innerHeight - footerY, footerHeight) : 0 | ||
); | ||
const visibleFooterCssProp = `${visibleFooterHeight}px`; | ||
@@ -46,2 +49,12 @@ | ||
window.addEventListener('DOMContentLoaded', setLayoutCssVariables, { passive: true }); | ||
// determine if header/footer are visible below the top of the viewport | ||
window.addEventListener( | ||
'scroll', | ||
() => window.dispatchEvent(new CustomEvent('atlas-layout-change-event')), | ||
{ | ||
passive: true | ||
} | ||
); | ||
} |
Sorry, the diff of this file is not supported yet
117049
2873