react-code-dataset / wp-calypso /client /site-profiler /utils /calculate-metrics-section-scroll-offset.ts
react-code-dataset / wp-calypso /client /site-profiler /utils /calculate-metrics-section-scroll-offset.ts
Download wp-calypso/client/site-profiler/utils/calculate-metrics-section-scroll-offset.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/site-profiler/utils/calculate-metrics-section-scroll-offset.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/site-profiler/utils/calculate-metrics-section-scroll-offset.ts
-
curl -L -o calculate-metrics-section-scroll-offset.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/site-profiler/utils/calculate-metrics-section-scroll-offset.ts
466 Bytes
| export function calculateMetricsSectionScrollOffset() { | |
| let offset = 0; | |
| const headerEl = document.getElementById( 'header' ); | |
| const menuHeight = 92; | |
| // Offset to account for Masterbar if it is fixed position | |
| offset += | |
| headerEl && getComputedStyle( headerEl ).position === 'fixed' | |
| ? headerEl.getBoundingClientRect().height | |
| : 0; | |
| // Offset to account for the metrics menu navbar | |
| offset += menuHeight; | |
| const padding = 30; | |
| return offset + padding; | |
| } | |