diff --git a/shortcuts/sticky-elements/waypoints-sticky.coffee b/shortcuts/sticky-elements/waypoints-sticky.coffee index 24eceea5..88d430b3 100644 --- a/shortcuts/sticky-elements/waypoints-sticky.coffee +++ b/shortcuts/sticky-elements/waypoints-sticky.coffee @@ -65,8 +65,8 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt options.handler = (direction) -> $sticky = $(this).children ':first' shouldBeStuck = direction in ['down', 'right'] - $sticky.toggleClass options.stuckClass, shouldBeStuck $wrap.height if shouldBeStuck then $sticky.outerHeight() else '' + $sticky.toggleClass options.stuckClass, shouldBeStuck originalHandler.call this, direction if originalHandler? $wrap.waypoint options this.data 'stuckClass', options.stuckClass diff --git a/shortcuts/sticky-elements/waypoints-sticky.js b/shortcuts/sticky-elements/waypoints-sticky.js index ceda329a..3a86f1d6 100644 --- a/shortcuts/sticky-elements/waypoints-sticky.js +++ b/shortcuts/sticky-elements/waypoints-sticky.js @@ -36,8 +36,8 @@ https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt $sticky = $(this).children(':first'); shouldBeStuck = direction === 'down' || direction === 'right'; - $sticky.toggleClass(options.stuckClass, shouldBeStuck); $wrap.height(shouldBeStuck ? $sticky.outerHeight() : ''); + $sticky.toggleClass(options.stuckClass, shouldBeStuck); if (originalHandler != null) { return originalHandler.call(this, direction); } diff --git a/shortcuts/sticky-elements/waypoints-sticky.min.js b/shortcuts/sticky-elements/waypoints-sticky.min.js index 3962802c..bbe1a76c 100644 --- a/shortcuts/sticky-elements/waypoints-sticky.min.js +++ b/shortcuts/sticky-elements/waypoints-sticky.min.js @@ -5,4 +5,4 @@ Copyright (c) 2011-2014 Caleb Troughton Dual licensed under the MIT license and GPL license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ -(function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(this,function(t){var n,s;n={wrapper:'
',stuckClass:"stuck"};s=function(t,n){t.wrap(n.wrapper);return t.parent()};t.waypoints("extendFn","sticky",function(e){var i,r,a;r=t.extend({},t.fn.waypoint.defaults,n,e);i=s(this,r);a=r.handler;r.handler=function(n){var s,e;s=t(this).children(":first");e=n==="down"||n==="right";s.toggleClass(r.stuckClass,e);i.height(e?s.outerHeight():"");if(a!=null){return a.call(this,n)}};i.waypoint(r);return this.data("stuckClass",r.stuckClass)});return t.waypoints("extendFn","unsticky",function(){this.parent().waypoint("destroy");this.unwrap();return this.removeClass(this.data("stuckClass"))})})}).call(this); \ No newline at end of file +(function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(this,function(t){var n,s;n={wrapper:'',stuckClass:"stuck"};s=function(t,n){t.wrap(n.wrapper);return t.parent()};t.waypoints("extendFn","sticky",function(e){var i,r,a;r=t.extend({},t.fn.waypoint.defaults,n,e);i=s(this,r);a=r.handler;r.handler=function(n){var s,e;s=t(this).children(":first");e=n==="down"||n==="right";i.height(e?s.outerHeight():"");s.toggleClass(r.stuckClass,e);if(a!=null){return a.call(this,n)}};i.waypoint(r);return this.data("stuckClass",r.stuckClass)});return t.waypoints("extendFn","unsticky",function(){this.parent().waypoint("destroy");this.unwrap();return this.removeClass(this.data("stuckClass"))})})}).call(this);