]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: position and offset were undefined in start callback, fixes #4380
authorPaul Bakaus <paul.bakaus@googlemail.com>
Sat, 22 Aug 2009 08:10:19 +0000 (08:10 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Sat, 22 Aug 2009 08:10:19 +0000 (08:10 +0000)
ui/ui.draggable.js

index e0b587691edafc9e593a50495d4348f7e69e78d3..df555e68642192485db1fc9daada2ab6f61b4dd4 100644 (file)
@@ -83,7 +83,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
                this.scrollParent = this.helper.scrollParent();
 
                //The element's absolute position on the page minus margins
-               this.offset = this.element.offset();
+               this.offset = this.positionAbs = this.element.offset();
                this.offset = {
                        top: this.offset.top - this.margins.top,
                        left: this.offset.left - this.margins.left
@@ -99,7 +99,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
                });
 
                //Generate the original position
-               this.originalPosition = this._generatePosition(event);
+               this.originalPosition = this.position = this._generatePosition(event);
                this.originalPageX = event.pageX;
                this.originalPageY = event.pageY;