vendor/assets/javascripts/uikit/addons/nestable.js in uikit-sass-rails-1.0.0 vs vendor/assets/javascripts/uikit/addons/nestable.js in uikit-sass-rails-1.1.0

- old
+ new

@@ -1,6 +1,6 @@ -/*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ +/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /* * Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/ */ (function(addon) { @@ -20,11 +20,11 @@ })(function($, UI) { var hasTouch = 'ontouchstart' in window, html = $("html"), touchedlists = [], - $win = $(window); + $win = UI.$win; /** * Detect CSS pointer-events property * events are normally disabled on the dragging element to avoid conflicts * https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js @@ -556,18 +556,19 @@ } } }); - $(document).on("uk-domready", function(e) { + // init code + UI.ready(function(context) { - $("[data-uk-nestable]").each(function(){ + $("[data-uk-nestable]", context).each(function(){ - var ele = $(this); + var ele = $(this); - if(!ele.data("nestable")) { - var plugin = UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable"))); - } + if(!ele.data("nestable")) { + var plugin = UI.nestable(ele, UI.Utils.options(ele.attr("data-uk-nestable"))); + } }); }); return UI.nestable; }); \ No newline at end of file