Droppable: Account for draggable helper when calculating proportions.

This commit is contained in:
Scott González 2012-01-15 13:44:52 -05:00
parent 2c9ee0252d
commit 0e96a50231

View File

@ -72,14 +72,13 @@ $.widget( "ui.droppable", {
/** draggable integration **/ /** draggable integration **/
_draggableStart: function( event, ui ) { _draggableStart: function( event, ui ) {
var draggable = $( event.target ); var draggable = ui.helper ? ui.helper[0] : event.target;
// TODO: Possibly move into draggable hash // TODO: Possibly move into draggable hash
// so if there are multiple droppables, it's not recalculating all the time // so if there are multiple droppables, it's not recalculating all the time
// TODO: Should this use the helper if it exists?
this.draggableProportions = { this.draggableProportions = {
width: draggable[0].offsetWidth, width: draggable.offsetWidth,
height: draggable[0].offsetHeight height: draggable.offsetHeight
}; };
}, },