UX: Use header top to calculate docking position

This commit is contained in:
Vinoth Kannan 2018-11-14 16:31:39 +05:30
parent 777364df01
commit d078808144
1 changed files with 4 additions and 3 deletions

View File

@ -24,13 +24,14 @@ const SiteHeaderComponent = MountWidget.extend(Docking, {
}, },
dockCheck(info) { dockCheck(info) {
const $body = $("body"); const $header = $("header.d-header");
if (this.docAt === null) { if (this.docAt === null) {
if (!($body && $body.length === 1)) return; if (!($header && $header.length === 1)) return;
this.docAt = $body.offset().top; this.docAt = $header.offset().top;
} }
const $body = $("body");
const offset = info.offset(); const offset = info.offset();
if (offset >= this.docAt) { if (offset >= this.docAt) {
if (!this.dockedHeader) { if (!this.dockedHeader) {