Fix positioning error with draggable, revert and grid
[lhc/web/wiklou.git] / resources / lib / jquery.ui / jquery.ui.draggable.js
index 3768022..723dbd4 100644 (file)
@@ -133,9 +133,13 @@ $.widget("ui.draggable", $.ui.mouse, {
                });
 
                //Generate the original position
-               this.originalPosition = this.position = this._generatePosition(event);
                this.originalPageX = event.pageX;
                this.originalPageY = event.pageY;
+               this.originalPosition = this.position = this._generatePosition(event);
+               // These lines where moved up to fix an issue with with draggable, revert and grid
+               // See: https://bugs.jqueryui.com/ticket/4696 and https://gerrit.wikimedia.org/r/#/c/333224
+               // this.originalPageX = event.pageX;
+               // this.originalPageY = event.pageY;
 
                //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
                (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));