r921 - trunk/ui

r921 - trunk/ui


Author: eduardolundgren
Date: Tue Nov 11 20:34:34 2008
New Revision: 921
Modified:
trunk/ui/ui.sortable.js
Log:
Sortable: More accuracy improvements.
Modified: trunk/ui/ui.sortable.js
==============================================================================
--- trunk/ui/ui.sortable.js    (original)
+++ trunk/ui/ui.sortable.js    Tue Nov 11 20:34:34 2008
@@ -158,27 +158,23 @@
        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 @@
    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;