Skip to content

Commit 4bd1a9c

Browse files
committed
Draggable: Make sure positional constraints are never applied to ui.originalPosition
1 parent 619261f commit 4bd1a9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/jquery.ui.draggable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ $.widget("ui.draggable", $.ui.mouse, {
166166
});
167167

168168
//Generate the original position
169-
this.originalPosition = this.position = this._generatePosition(event);
169+
this.originalPosition = this.position = this._generatePosition( event, false );
170170
this.originalPageX = event.pageX;
171171
this.originalPageY = event.pageY;
172172

@@ -208,7 +208,7 @@ $.widget("ui.draggable", $.ui.mouse, {
208208
}
209209

210210
//Compute the helpers position
211-
this.position = this._generatePosition(event);
211+
this.position = this._generatePosition( event, true );
212212
this.positionAbs = this._convertPositionTo("absolute");
213213

214214
//Call plugins and callbacks and use the resulting position if something is returned
@@ -488,7 +488,7 @@ $.widget("ui.draggable", $.ui.mouse, {
488488

489489
},
490490

491-
_generatePosition: function(event) {
491+
_generatePosition: function( event, constrainPosition ) {
492492

493493
var containment, co, top, left,
494494
o = this.options,
@@ -513,7 +513,7 @@ $.widget("ui.draggable", $.ui.mouse, {
513513
*/
514514

515515
// If we are not dragging yet, we won't check for options
516-
if ( this.originalPosition ) {
516+
if ( constrainPosition ) {
517517
if ( this.containment ) {
518518
if ( this.relative_container ){
519519
co = this.relative_container.offset();

0 commit comments

Comments
 (0)