From 26e716e404f4408f194b614114a88a9f4c93f3b7 Mon Sep 17 00:00:00 2001 From: "g.chanaud" Date: Fri, 8 Apr 2016 19:50:29 +0200 Subject: [PATCH] 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 --- js/foundation.sticky.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); + }); } /** -- 2.47.2