vendor/assets/javascripts/uikit/components/sticky.js in uikit2-rails-0.1.5 vs vendor/assets/javascripts/uikit/components/sticky.js in uikit2-rails-0.1.6

- old
+ new

@@ -1,6 +1,6 @@ -/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ +/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function(addon) { var component; if (window.UIkit) { @@ -79,15 +79,15 @@ }); }, init: function() { - var wrapper = UI.$('<div class="uk-sticky-placeholder"></div>'), boundary = this.options.boundary, boundtoparent; + var boundary = this.options.boundary, boundtoparent; - this.wrapper = this.element.css('margin', 0).wrap(wrapper).parent(); - + this.wrapper = this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(); this.computeWrapper(); + this.element.css('margin', 0); if (boundary) { if (boundary === true || boundary[0] === '!') { @@ -300,11 +300,10 @@ if (sticky.currentTop != newTop) { sticky.element.css({ position : "fixed", top : newTop, - width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width(), - left : sticky.wrapper.offset().left + width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width() }); if (!sticky.init) { sticky.element.addClass(sticky.options.clsinit);