mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Droppable: Added in "fit" tolerance
This commit is contained in:
parent
cc514e0ec7
commit
648f4167eb
8
ui/jquery.ui.droppable.js
vendored
8
ui/jquery.ui.droppable.js
vendored
@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user