mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Sortable: More accuracy improvements.
This commit is contained in:
parent
d7707b1fb1
commit
71ae568116
@ -158,27 +158,23 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
|
|||||||
var verticalDirection = this._getDragVerticalDirection();
|
var verticalDirection = this._getDragVerticalDirection();
|
||||||
var horizontalDirection = this._getDragHorizontalDirection();
|
var horizontalDirection = this._getDragHorizontalDirection();
|
||||||
|
|
||||||
|
if (!isOverElement) return false;
|
||||||
|
|
||||||
if (this.floating) {
|
if (this.floating) {
|
||||||
if (isOverElement) {
|
|
||||||
|
|
||||||
if (!horizontalDirection) {
|
if (!horizontalDirection) {
|
||||||
return false;
|
return verticalDirection == "down" ? 2 : 1;
|
||||||
}
|
|
||||||
|
|
||||||
var direction = horizontalDirection == "right" ? 2 : 1;
|
|
||||||
return direction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return horizontalDirection == "right" ? 2 : 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isOverElement) {
|
|
||||||
|
|
||||||
if (!verticalDirection) {
|
if (!verticalDirection) {
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
var direction = verticalDirection == "down" ? 2 : 1;
|
|
||||||
return direction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return verticalDirection == "down" ? 2 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -948,7 +944,7 @@ $.ui.plugin.add("sortable", "axis", {
|
|||||||
sort: function(e, ui) {
|
sort: function(e, ui) {
|
||||||
|
|
||||||
var i = $(this).data("sortable");
|
var i = $(this).data("sortable");
|
||||||
|
console.log(i.position.left, i.originalPosition.left);
|
||||||
if(ui.options.axis == "y") i.position.left = i.originalPosition.left;
|
if(ui.options.axis == "y") i.position.left = i.originalPosition.left;
|
||||||
if(ui.options.axis == "x") i.position.top = i.originalPosition.top;
|
if(ui.options.axis == "x") i.position.top = i.originalPosition.top;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user