]> source.dussan.org Git - jquery-ui.git/commitdiff
simulate - drag: added mousemove [+1, +1] after mousedown. Removed mouseover and...
authorRichard Worth <rdworth@gmail.com>
Sat, 21 Jun 2008 10:52:58 +0000 (10:52 +0000)
committerRichard Worth <rdworth@gmail.com>
Sat, 21 Jun 2008 10:52:58 +0000 (10:52 +0000)
tests/resizable.js
tests/simulate/jquery.simulate.js

index 2e7da9adc0009b35025d4e51e1277ef4a393923c..d23cbd7b2d5d338df4b8e9139ec241c5538353fb 100644 (file)
@@ -8,6 +8,10 @@ var drag = function(el, dx, dy, complete) {
        // speed = sync -> Drag syncrhonously.
        // speed = fast|slow -> Drag asyncrhonously - animated.
        
+       //this mouseover is to work around a limitation in resizable
+       //TODO: fix resizable so handle doesn't require mouseover in order to be used
+       $(el).simulate("mouseover");
+
        return $(el).simulate("drag", {
                dx: dx||0, dy: dy||0, speed: 'sync', complete: complete 
        });
index a0dc290dacd4c6b03ac0228989e6c509a1c4baf0..b55687388b3f5d100068fb791d81a2e8a693061e 100644 (file)
@@ -115,13 +115,13 @@ $.extend($.simulate.prototype, {
                        options = this.options, x = Math.floor(center.x), y = Math.floor(center.y), \r
                        dx = options.dx || 0, dy = options.dy || 0, target = this.target;\r
                var coord = { clientX: x, clientY: y };\r
-               this.simulateEvent(target, "mouseover");\r
                this.simulateEvent(target, "mousedown", coord);\r
+               coord = { clientX: x + 1, clientY: y + 1 };\r
+               this.simulateEvent(document, "mousemove", coord);\r
                coord = { clientX: x + dx, clientY: y + dy };\r
                this.simulateEvent(document, "mousemove", coord);\r
                this.simulateEvent(document, "mousemove", coord);\r
                this.simulateEvent(target, "mouseup", coord);\r
-               this.simulateEvent(target, "mouseout");\r
        },\r
        findCenter: function(el) {\r
                var el = $(this.target), o = el.offset();\r