mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Grid will snap at >= half rather than just >
This commit is contained in:
parent
7ad8f54a5a
commit
1495a61298
8
ui/jquery.ui.draggable.js
vendored
8
ui/jquery.ui.draggable.js
vendored
@ -789,18 +789,18 @@ if ( $.uiBackCompat !== false ) {
|
||||
|
||||
// If x is actually something, check that user is at least half way to next point
|
||||
if ( x ) {
|
||||
if ( ui.position.left - currentX > x/2 ) {
|
||||
if ( ui.position.left - currentX >= x/2 ) {
|
||||
currentX = currentX + x;
|
||||
} else if ( currentX - ui.position.left > x/2 ) {
|
||||
} else if ( currentX - ui.position.left >= x/2 ) {
|
||||
currentX = currentX - x;
|
||||
}
|
||||
}
|
||||
|
||||
// If y is actually something, check that user is at least half way to next point
|
||||
if ( y ) {
|
||||
if ( ui.position.top - currentY > y/2 ) {
|
||||
if ( ui.position.top - currentY >= y/2 ) {
|
||||
currentY = currentY + y;
|
||||
} else if ( currentY - ui.position.top > y/2 ) {
|
||||
} else if ( currentY - ui.position.top >= y/2 ) {
|
||||
currentY = currentY - y;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user