From: g.chanaud Date: Fri, 8 Apr 2016 17:50:29 +0000 (+0200) Subject: Add setSize handler on setSticky for having the container resizing correctly if stick... X-Git-Tag: v6.2.2-rc1~69^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8553%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Add setSize handler on setSticky for having the container resizing correctly if sticky and anchored height are different. Waiting for the height transition on the container to finish before firing the setSize --- diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index dfa3ca9a3..cfe356ffc 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -195,7 +195,8 @@ class Sticky { * @private */ _setSticky() { - var stickTo = this.options.stickTo, + var _this = this, + stickTo = this.options.stickTo, mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom', notStuckTo = stickTo === 'top' ? 'bottom' : 'top', css = {}; @@ -214,6 +215,9 @@ class Sticky { * @event Sticky#stuckto */ .trigger(`sticky.zf.stuckto:${stickTo}`); + this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function() { + _this._setSizes(); + }); } /**