diff options
author | Corey Frang <gnarf@gnarf.net> | 2013-01-30 08:32:48 -0600 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-03-19 16:08:00 +0100 |
commit | 4fce29e9356d7cbe2ccbdc29a391603580e852de (patch) | |
tree | beb7e73d7a1b7fab36229c7992778c77ed56350a /ui/jquery.ui.draggable.js | |
parent | 38c7b1ca814c59c48522cda6cfdf054c61773959 (diff) | |
download | jquery-ui-4fce29e9356d7cbe2ccbdc29a391603580e852de.tar.gz jquery-ui-4fce29e9356d7cbe2ccbdc29a391603580e852de.zip |
Widgets: Updating to use instance method on bridge
Diffstat (limited to 'ui/jquery.ui.draggable.js')
-rw-r--r-- | ui/jquery.ui.draggable.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 605425859..a16b022d7 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -563,7 +563,7 @@ $.widget("ui.draggable", $.ui.mouse, { $.ui.plugin.add("draggable", "connectToSortable", { start: function(event, ui) { - var inst = $(this).data("ui-draggable"), o = inst.options, + var inst = $(this).draggable( "instance" ), o = inst.options, uiSortable = $.extend({}, ui, { item: inst.element }); inst.sortables = []; $(o.connectToSortable).each(function() { @@ -582,7 +582,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { stop: function(event, ui) { //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper - var inst = $(this).data("ui-draggable"), + var inst = $(this).draggable( "instance" ), uiSortable = $.extend({}, ui, { item: inst.element }); $.each(inst.sortables, function() { @@ -618,7 +618,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { }, drag: function(event, ui) { - var inst = $(this).data("ui-draggable"), that = this; + var inst = $(this).draggable( "instance" ), that = this; $.each(inst.sortables, function() { @@ -719,14 +719,14 @@ $.ui.plugin.add("draggable", "connectToSortable", { $.ui.plugin.add("draggable", "cursor", { start: function() { - var t = $("body"), o = $(this).data("ui-draggable").options; + var t = $("body"), o = $(this).draggable( "instance" ).options; if (t.css("cursor")) { o._cursor = t.css("cursor"); } t.css("cursor", o.cursor); }, stop: function() { - var o = $(this).data("ui-draggable").options; + var o = $(this).draggable( "instance" ).options; if (o._cursor) { $("body").css("cursor", o._cursor); } @@ -735,14 +735,14 @@ $.ui.plugin.add("draggable", "cursor", { $.ui.plugin.add("draggable", "opacity", { start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("ui-draggable").options; + var t = $(ui.helper), o = $(this).draggable( "instance" ).options; if(t.css("opacity")) { o._opacity = t.css("opacity"); } t.css("opacity", o.opacity); }, stop: function(event, ui) { - var o = $(this).data("ui-draggable").options; + var o = $(this).draggable( "instance" ).options; if(o._opacity) { $(ui.helper).css("opacity", o._opacity); } @@ -751,14 +751,14 @@ $.ui.plugin.add("draggable", "opacity", { $.ui.plugin.add("draggable", "scroll", { start: function() { - var i = $(this).data("ui-draggable"); + var i = $(this).draggable( "instance" ); if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { i.overflowOffset = i.scrollParent.offset(); } }, drag: function( event ) { - var i = $(this).data("ui-draggable"), o = i.options, scrolled = false; + var i = $(this).draggable( "instance" ), o = i.options, scrolled = false; if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { @@ -808,7 +808,7 @@ $.ui.plugin.add("draggable", "scroll", { $.ui.plugin.add("draggable", "snap", { start: function() { - var i = $(this).data("ui-draggable"), + var i = $(this).draggable( "instance" ), o = i.options; i.snapElements = []; @@ -829,7 +829,7 @@ $.ui.plugin.add("draggable", "snap", { drag: function(event, ui) { var ts, bs, ls, rs, l, r, t, b, i, first, - inst = $(this).data("ui-draggable"), + inst = $(this).draggable( "instance" ), o = inst.options, d = o.snapTolerance, x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, @@ -903,7 +903,7 @@ $.ui.plugin.add("draggable", "snap", { $.ui.plugin.add("draggable", "stack", { start: function() { var min, - o = this.data("ui-draggable").options, + o = $(this).draggable( "instance" ).options, group = $.makeArray($(o.stack)).sort(function(a,b) { return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); }); @@ -920,14 +920,14 @@ $.ui.plugin.add("draggable", "stack", { $.ui.plugin.add("draggable", "zIndex", { start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("ui-draggable").options; + var t = $(ui.helper), o = $(this).draggable( "instance" ).options; if(t.css("zIndex")) { o._zIndex = t.css("zIndex"); } t.css("zIndex", o.zIndex); }, stop: function(event, ui) { - var o = $(this).data("ui-draggable").options; + var o = $(this).draggable( "instance" ).options; if(o._zIndex) { $(ui.helper).css("zIndex", o._zIndex); } |