]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Remove seemingly unnecessary left offset from sticky 9413/head
authorKevin Ball <kmball11@gmail.com>
Mon, 28 Nov 2016 23:32:19 +0000 (15:32 -0800)
committerKevin Ball <kmball11@gmail.com>
Mon, 28 Nov 2016 23:32:19 +0000 (15:32 -0800)
js/foundation.sticky.js

index 86e39159c6b231632b7b19780b41c662f30778e7..e3f859025e657f8cf1c51dd83d4c507c3c97b9a3 100644 (file)
@@ -204,7 +204,6 @@ class Sticky {
     css[mrgn] = `${this.options[mrgn]}em`;
     css[stickTo] = 0;
     css[notStuckTo] = 'auto';
-    css['left'] = this.$container.offset().left + parseInt(window.getComputedStyle(this.$container[0])["padding-left"], 10);
     this.isStuck = true;
     this.$element.removeClass(`is-anchored is-at-${notStuckTo}`)
                  .addClass(`is-stuck is-at-${stickTo}`)
@@ -246,7 +245,6 @@ class Sticky {
       css['top'] = anchorPt;
     }
 
-    css['left'] = '';
     this.isStuck = false;
     this.$element.removeClass(`is-stuck is-at-${stickTo}`)
                  .addClass(`is-anchored is-at-${topOrBottom}`)
@@ -296,9 +294,7 @@ class Sticky {
     });
     this.elemHeight = newContainerHeight;
 
-    if (this.isStuck) {
-      this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)});
-    } else {
+    if (!this.isStuck) {
       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);