]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Merge pull request #10359 from ixti/patch-1
authorJacob <jacobthornton@gmail.com>
Tue, 24 Dec 2013 21:21:19 +0000 (13:21 -0800)
committerJacob <jacobthornton@gmail.com>
Tue, 24 Dec 2013 21:21:19 +0000 (13:21 -0800)
Pass $element to offset top/bottom calc funcs

1  2 
js/affix.js

diff --cc js/affix.js
index 2fbafc6a8e801c65f5b7abf21e299b3500612a4c,84760779d5433a334d2279a8df3e07e6c9d726bc..94d3cc224c21a4edfbde09864d82d52c5b57a2e2
      var offsetTop    = offset.top
      var offsetBottom = offset.bottom
  
 +    if (this.affixed == 'top') position.top += scrollTop
 +
      if (typeof offset != 'object')         offsetBottom = offsetTop = offset
-     if (typeof offsetTop == 'function')    offsetTop    = offset.top()
-     if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
+     if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
+     if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
  
      var affix = this.unpin   != null && (scrollTop + this.unpin <= position.top) ? false :
                  offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :