From ac7b05884917c8949ad9690d1e3b63eeb7f6303f Mon Sep 17 00:00:00 2001 From: Joe <33972521+hnb-ku@users.noreply.github.com> Date: Tue, 13 Nov 2018 14:47:12 +0800 Subject: [PATCH] UX: take custom markup into account when docking header --- .../javascripts/discourse/components/site-header.js.es6 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/site-header.js.es6 b/app/assets/javascripts/discourse/components/site-header.js.es6 index 5944ac9b244..3135911983d 100644 --- a/app/assets/javascripts/discourse/components/site-header.js.es6 +++ b/app/assets/javascripts/discourse/components/site-header.js.es6 @@ -24,13 +24,13 @@ const SiteHeaderComponent = MountWidget.extend(Docking, { }, dockCheck(info) { + const $body = $("body"); + if (this.docAt === null) { - const outlet = $("#main-outlet"); - if (!(outlet && outlet.length === 1)) return; - this.docAt = outlet.offset().top; + if (!($body && $body.length === 1)) return; + this.docAt = $body.offset().top; } - const $body = $("body"); const offset = info.offset(); if (offset >= this.docAt) { if (!this.dockedHeader) {