vendor/assets/javascripts/uikit/core/utility.js in uikit2-rails-0.1.7 vs vendor/assets/javascripts/uikit/core/utility.js in uikit2-rails-0.1.8

- old
+ new

@@ -1,17 +1,18 @@ -/*! UIkit 2.26.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ +/*! UIkit 2.26.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function(UI) { "use strict"; var stacks = []; UI.component('stackMargin', { defaults: { cls: 'uk-margin-small-top', - rowfirst: false + rowfirst: false, + observe: false }, boot: function() { // init code @@ -44,16 +45,19 @@ }); return UI.Utils.debounce(fn, 20); })()); - UI.$html.on("changed.uk.dom", function(e) { - $this.process(); - }); - this.on("display.uk.check", function(e) { if (this.element.is(":visible")) this.process(); }.bind(this)); + + if (this.options.observe) { + + UI.domObserve(this.element, function(e) { + if ($this.element.is(":visible")) $this.process(); + }); + } stacks.push(this); }, process: function() {