From: Kevin Ball Date: Mon, 28 Nov 2016 23:32:19 +0000 (-0800) Subject: Remove seemingly unnecessary left offset from sticky X-Git-Tag: v6.3-rc1~6^2~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b12cdd8370624c05f2e9c2c4b79838f33d22ed5f;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Remove seemingly unnecessary left offset from sticky --- 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);