mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Pass pointer position in the ui hash for all events.
This commit is contained in:
parent
66a594ec76
commit
003bbf42fc
11
ui/jquery.ui.draggable.js
vendored
11
ui/jquery.ui.draggable.js
vendored
@ -101,7 +101,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
this._preparePosition( pointerPosition );
|
||||
|
||||
// If user cancels start, don't allow dragging
|
||||
if ( this._trigger( "start", event, this._uiHash() ) === false ) {
|
||||
if ( this._trigger( "start", event, this._uiHash( pointerPosition ) ) === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
this._preparePosition( pointerPosition );
|
||||
|
||||
// If user cancels drag, don't move the element
|
||||
if ( this._trigger( "drag", event, this._uiHash() ) === false ) {
|
||||
if ( this._trigger( "drag", event, this._uiHash( pointerPosition ) ) === false ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
this._preparePosition( pointerPosition );
|
||||
|
||||
// If user cancels stop, leave helper there, disallow any CSS changes
|
||||
if ( this._trigger( "stop", event, this._uiHash() ) !== false ) {
|
||||
if ( this._trigger( "stop", event, this._uiHash( pointerPosition ) ) !== false ) {
|
||||
this._setCss();
|
||||
if ( this.options.helper ) {
|
||||
this.dragEl.remove();
|
||||
@ -261,11 +261,12 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
});
|
||||
},
|
||||
|
||||
_uiHash: function() {
|
||||
_uiHash: function( pointerPosition ) {
|
||||
// TODO: add originalPosition
|
||||
var ret = {
|
||||
position: this.position,
|
||||
offset: this.offset
|
||||
offset: this.offset,
|
||||
pointer: pointerPosition
|
||||
};
|
||||
|
||||
if ( this.options.helper ) {
|
||||
|
Loading…
Reference in New Issue
Block a user