]> source.dussan.org Git - jquery-ui.git/commitdiff
userAction fix for top when not defined
authorEduardo Lundgren <eduardolundgren@gmail.com>
Sun, 1 Jun 2008 13:52:50 +0000 (13:52 +0000)
committerEduardo Lundgren <eduardolundgren@gmail.com>
Sun, 1 Jun 2008 13:52:50 +0000 (13:52 +0000)
ui/tests/jquery.useraction.js

index 510a42e68735ac9ceb9d22e42d6fe3f203a0a155..b7e19a009a4688ba83637d1223d6f7b11c0125dd 100644 (file)
@@ -152,7 +152,7 @@ $.extend($.userAction.prototype, {
                        self.down(target);
                        
                        var mdx = Math.abs(dx)||0, mdy = Math.abs(dy)||0, range = Math.max(mdx, mdy),
-                               sx = dx/mdx, sy = dy/mdy;
+                               sx = dx/mdx||1, sy = dy/mdy||1;
                        
                        for (var dt = 1; dt <= range; dt++) {
                                var x = center.x + sx*(dt <= mdx ? dt : 0), y = center.y + sy*(dt <= mdy ? dt : 0);