FIX: make full height menu and cloak respect custom headers

This commit is contained in:
Jeff Wong 2019-01-02 10:59:26 -08:00
parent cb9bee4153
commit a61d9deba1
1 changed files with 8 additions and 1 deletions

View File

@ -367,7 +367,7 @@ const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
$headerCloak.show();
}
const menuTop = this.site.mobileView ? 0 : headerHeight();
const menuTop = this.site.mobileView ? headerTop() : headerHeight();
let height;
const winHeightOffset = 16;
@ -386,6 +386,7 @@ const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
}
if (style.top !== menuTop + "px" || style.height !== height) {
$panel.css({ top: menuTop + "px", height });
$(".header-cloak").css({ top: menuTop + "px" });
}
$("body").removeClass("drop-down-mode");
}
@ -434,3 +435,9 @@ export function headerHeight() {
$header.outerHeight() + headerOffsetTop - $(window).scrollTop()
);
}
export function headerTop() {
const $header = $("header.d-header");
const headerOffset = $header.offset();
return headerOffset ? headerOffset.top : 0;
}