From 0e96a50231b91f23a3284a5e922778c5762d3652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 15 Jan 2012 13:44:52 -0500 Subject: [PATCH] Droppable: Account for draggable helper when calculating proportions. --- ui/jquery.ui.droppable.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 3d1823ca5..8cc8e5b44 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -72,14 +72,13 @@ $.widget( "ui.droppable", { /** draggable integration **/ _draggableStart: function( event, ui ) { - var draggable = $( event.target ); + var draggable = ui.helper ? ui.helper[0] : event.target; // TODO: Possibly move into draggable hash // so if there are multiple droppables, it's not recalculating all the time - // TODO: Should this use the helper if it exists? this.draggableProportions = { - width: draggable[0].offsetWidth, - height: draggable[0].offsetHeight + width: draggable.offsetWidth, + height: draggable.offsetHeight }; },