From: g.chanaud Date: Sat, 30 Apr 2016 10:41:55 +0000 (+0200) Subject: [Bugfix] Sticky : Anchored element's not following the flow when resizing the window... X-Git-Tag: v6.2.2-rc1~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8715%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git [Bugfix] Sticky : Anchored element's not following the flow when resizing the window and going over/behind other elements --- diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index cfe356ffc..8055eeb12 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -294,9 +294,14 @@ class Sticky { }); this.elemHeight = newContainerHeight; - if (this.isStuck) { - this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); - } + if (this.isStuck) { + this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); + } else { + if (this.$element.hasClass('is-at-bottom')) { + var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight; + this.$element.css('top', anchorPt); + } + } this._setBreakPoints(newContainerHeight, function() { if (cb) { cb(); }