From 90135b27f896506776f3ce9fdbd27c9e957b924a Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Tue, 19 Mar 2013 16:53:35 +0100 Subject: Widget tests: Use instance method. Also replace a few instances of $.data in widget implementations. --- ui/jquery.ui.draggable.js | 2 +- ui/jquery.ui.droppable.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index a16b022d7..e5fc069b9 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -567,7 +567,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { uiSortable = $.extend({}, ui, { item: inst.element }); inst.sortables = []; $(o.connectToSortable).each(function() { - var sortable = $.data(this, "ui-sortable"); + var sortable = $( this ).sortable( "instance" ); if (sortable && !sortable.options.disabled) { inst.sortables.push({ instance: sortable, diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 34342d33d..6bc4b594d 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -152,7 +152,7 @@ $.widget("ui.droppable", { } this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() { - var inst = $.data(this, "ui-droppable"); + var inst = $( this ).droppable( "instance" ); if( inst.options.greedy && !inst.options.disabled && @@ -331,11 +331,11 @@ $.ui.ddmanager = { // find droppable parents with same scope scope = this.options.scope; parent = this.element.parents(":data(ui-droppable)").filter(function () { - return $.data(this, "ui-droppable").options.scope === scope; + return $(this).droppable( "instance" ).options.scope === scope; }); if (parent.length) { - parentInstance = $.data(parent[0], "ui-droppable"); + parentInstance = $( parent[ 0 ] ).droppable( "instance" ); parentInstance.greedyChild = (c === "isover"); } } -- cgit v1.2.3