diff options
author | Eduardo Lundgren <eduardolundgren@gmail.com> | 2008-11-12 04:34:34 +0000 |
---|---|---|
committer | Eduardo Lundgren <eduardolundgren@gmail.com> | 2008-11-12 04:34:34 +0000 |
commit | 71ae56811609d949aea5df773129febe803ea4f9 (patch) | |
tree | f189bec5175204c4155a68af03ebdc2c4af7001f /ui | |
parent | d7707b1fb1ae0e23eb548ea44982a520b2e572a7 (diff) | |
download | jquery-ui-71ae56811609d949aea5df773129febe803ea4f9.tar.gz jquery-ui-71ae56811609d949aea5df773129febe803ea4f9.zip |
Sortable: More accuracy improvements.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.sortable.js | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index f87967a72..dda22a573 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -158,27 +158,23 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { var verticalDirection = this._getDragVerticalDirection(); var horizontalDirection = this._getDragHorizontalDirection(); - if (this.floating) { - if (isOverElement) { + if (!isOverElement) return false; - if (!horizontalDirection) { - return false; - } + if (this.floating) { - var direction = horizontalDirection == "right" ? 2 : 1; - return direction; + if (!horizontalDirection) { + return verticalDirection == "down" ? 2 : 1; } + + return horizontalDirection == "right" ? 2 : 1; } else { - if (isOverElement) { - if (!verticalDirection) { - return false; - } - - var direction = verticalDirection == "down" ? 2 : 1; - return direction; + if (!verticalDirection) { + return false; } + + return verticalDirection == "down" ? 2 : 1; } return false; @@ -948,7 +944,7 @@ $.ui.plugin.add("sortable", "axis", { sort: function(e, ui) { 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 == "x") i.position.top = i.originalPosition.top; |