]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
[Bugfix] Sticky : Anchored element's not following the flow when resizing the window... 8715/head
authorg.chanaud <g.chanaud@regence-production.ch>
Sat, 30 Apr 2016 10:41:55 +0000 (12:41 +0200)
committerg.chanaud <g.chanaud@regence-production.ch>
Sat, 30 Apr 2016 10:41:55 +0000 (12:41 +0200)
js/foundation.sticky.js

index cfe356ffc219b722731831a803fe0d95f68701f9..8055eeb12541605c7c47af177a835197060706a8 100644 (file)
@@ -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(); }