UX: take custom markup into account when docking header

UX: take custom markup into account when docking header

diff --git a/app/assets/javascripts/discourse/components/site-header.js.es6 b/app/assets/javascripts/discourse/components/site-header.js.es6
index 5944ac9..3135911 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) {

GitHub sha: ac7b0588

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit has been mentioned on Discourse Meta. There might be relevant details there: