From b12cdd8370624c05f2e9c2c4b79838f33d22ed5f Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Mon, 28 Nov 2016 15:32:19 -0800 Subject: [PATCH] Remove seemingly unnecessary left offset from sticky --- js/foundation.sticky.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index 86e39159c..e3f859025 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -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); -- 2.47.2