From 003bbf42fce113ab9668f3b66b60aa24b9b80d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 15 Jan 2012 13:34:46 -0500 Subject: [PATCH] Draggable: Pass pointer position in the ui hash for all events. --- ui/jquery.ui.draggable.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 9d29158b5..0218aa5b9 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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 ) {