mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
simulate - drag: added mousemove [+1, +1] after mousedown. Removed mouseover and mouseout as they're not minimal/required for drag. They were there as work-around for resizable. Moved work-around to resizable test.
This commit is contained in:
parent
2e920f0fea
commit
2361bda9ba
@ -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
|
||||
});
|
||||
|
@ -115,13 +115,13 @@ $.extend($.simulate.prototype, {
|
||||
options = this.options, x = Math.floor(center.x), y = Math.floor(center.y),
|
||||
dx = options.dx || 0, dy = options.dy || 0, target = this.target;
|
||||
var coord = { clientX: x, clientY: y };
|
||||
this.simulateEvent(target, "mouseover");
|
||||
this.simulateEvent(target, "mousedown", coord);
|
||||
coord = { clientX: x + 1, clientY: y + 1 };
|
||||
this.simulateEvent(document, "mousemove", coord);
|
||||
coord = { clientX: x + dx, clientY: y + dy };
|
||||
this.simulateEvent(document, "mousemove", coord);
|
||||
this.simulateEvent(document, "mousemove", coord);
|
||||
this.simulateEvent(target, "mouseup", coord);
|
||||
this.simulateEvent(target, "mouseout");
|
||||
},
|
||||
findCenter: function(el) {
|
||||
var el = $(this.target), o = el.offset();
|
||||
|
Loading…
Reference in New Issue
Block a user