CJVT updates August and September 2026
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Clears the fixed #offset-padding header out of the way of the page content
|
||||
// below it, for pages with no side menu (mirrors the same logic each
|
||||
// page-specific script - admin.js, dictionaries.js, help.js, etc. - already
|
||||
// duplicates for its own page).
|
||||
|
||||
window.addEventListener('load', adjustOffsetBy)
|
||||
window.addEventListener('resize', adjustOffsetBy)
|
||||
|
||||
function adjustOffsetBy() {
|
||||
const fixedTopSection = document.getElementById('fixed-top-section')
|
||||
const offsetMain = document.getElementById('offset-main')
|
||||
const offsetHeaderPadding = document.getElementById('offset-padding')
|
||||
if (!fixedTopSection || !offsetMain) return
|
||||
|
||||
if (document.body.clientWidth < 1200) {
|
||||
if (offsetHeaderPadding !== null) offsetMain.style.paddingTop = `0px`
|
||||
} else if (offsetHeaderPadding !== null) {
|
||||
const referenceHeight = fixedTopSection.offsetHeight
|
||||
const offsetHeaderHeight = offsetHeaderPadding.offsetHeight
|
||||
offsetMain.style.paddingTop = `${referenceHeight + offsetHeaderHeight}px`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user