From f3731397daa9865e4cee7f1203e304bb4ac855e9 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 12 Jan 2014 23:40:47 -0700 Subject: [PATCH] Delay Padding calculation until the header bar actually exists --- builds/appchan-x.user.js | 4 +++- builds/crx/script.js | 4 +++- src/Theming/Style.coffee | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index c47d82e2f..f0b4da33c 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -13501,6 +13501,9 @@ $.asap((function() { return d.body; }), this.asapInit); + $.asap((function() { + return Header.bar.parentElement; + }), Style.padding); $.on(window, "resize", Style.padding); return $.ready(this.readyInit); }, @@ -13525,7 +13528,6 @@ }, readyInit: function() { var exLink; - Style.padding(); Style.iconPositions(); if (exLink = $("#navtopright .exlinksOptionsLink", d.body)) { return $.on(exLink, "click", function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index 73eaefc18..008e344a0 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13495,6 +13495,9 @@ $.asap((function() { return d.body; }), this.asapInit); + $.asap((function() { + return Header.bar.parentElement; + }), Style.padding); $.on(window, "resize", Style.padding); return $.ready(this.readyInit); }, @@ -13520,7 +13523,6 @@ }, readyInit: function() { var exLink; - Style.padding(); Style.iconPositions(); if (exLink = $("#navtopright .exlinksOptionsLink", d.body)) { return $.on(exLink, "click", function() { diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index 2cd444d2a..1d941eace 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -28,6 +28,7 @@ Style = $.asap (-> d.head), Style.observe $.asap (-> d.body), @asapInit + $.asap (-> Header.bar.parentElement), Style.padding $.on window, "resize", Style.padding $.ready @readyInit @@ -54,7 +55,6 @@ Style = return readyInit: -> - Style.padding() Style.iconPositions() if exLink = $ "#navtopright .exlinksOptionsLink", d.body $.on exLink, "click", ->