Commit 36b4f90f authored by Nick O'Donoghue's avatar Nick O'Donoghue Committed by Chris Rebert

Fixes affix-top class not applying

Use scrollTop instead of colliderTop which uses the elements
offset().top, as the offset top does not account for padding.

This issue can be replicated by using a navbar-fixed-top and applying
relevant padding to the body. (A navbar-static-top with no padding on
the body does not encounter this issue)

Fixes #15078
Closes #15154 by merging it
parent da79ab94
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
var colliderTop = initializing ? scrollTop : position.top var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height var colliderHeight = initializing ? targetHeight : height
if (offsetTop != null && colliderTop <= offsetTop) return 'top' if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
return false return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment