Droppable: Added in "fit" tolerance

This commit is contained in:
Dave Stein 2013-02-18 20:44:49 -05:00
parent cc514e0ec7
commit 648f4167eb

View File

@ -174,6 +174,14 @@ $.extend( $.ui.droppable, {
pointer: function( event, edges, ui ) {
return ui.pointer.x >= this.offset.left && ui.pointer.x <= edges.right &&
ui.pointer.y >= this.offset.top && ui.pointer.y <= edges.bottom;
},
// Draggable should be entirely inside droppable
fit: function( event, edges, ui ) {
return edges.draggableRight <= edges.right &&
ui.offset.left >= this.offset.left &&
edges.draggableBottom <= edges.bottom &&
ui.offset.top >= this.offset.top;
}
},