Skip to content

Commit 26729bd

Browse files
committed
Draggable: Cleanup.
1 parent 97d2063 commit 26729bd

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

ui/jquery.ui.draggable.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@ $.widget( "ui.draggable", $.ui.interaction, {
164164
if ( this._trigger( "start", event,
165165
this._fullHash( pointerPosition ) ) === false ) {
166166

167-
// domPosition needs to be undone even if start is stopped,
168-
// otherwise this.dragEl will remain in the `appendTo` element
169-
this.startPosition = startPosition;
170-
this.startOffset = startOffset;
171-
this.dragEl.css({
172-
left: startCssLeft,
173-
top: startCssTop
174-
});
167+
// domPosition needs to be undone even if start is stopped,
168+
// otherwise this.dragEl will remain in the `appendTo` element
169+
this.startPosition = startPosition;
170+
this.startOffset = startOffset;
171+
this.dragEl.css({
172+
left: startCssLeft,
173+
top: startCssTop
174+
});
175175

176-
this._resetDomPosition();
177-
return false;
176+
this._resetDomPosition();
177+
return false;
178178
}
179179

180180
this._blockFrames();
@@ -309,7 +309,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
309309
},
310310

311311
_handleScrolling: function( pointerPosition ) {
312-
var newScrollTop, newScrollLeft,
312+
var newScrollTop, newScrollLeft, change,
313313
scrollTop = this.scrollParent.scrollTop(),
314314
scrollLeft = this.scrollParent.scrollLeft(),
315315
scrollSensitivity = this.scrollSensitivity,
@@ -324,10 +324,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
324324
xRight = this.overflow.width + overflowLeft - pointerPosition.x,
325325
xLeft = pointerPosition.x- overflowLeft,
326326
yBottom = this.overflow.height + overflowTop - pointerPosition.y,
327-
yTop = pointerPosition.y - overflowTop,
328-
329-
// Accounts for change in scrollbar to modify "original" pointer
330-
change;
327+
yTop = pointerPosition.y - overflowTop;
331328

332329
// Handle vertical scrolling
333330
if ( yBottom < scrollSensitivity ) {

0 commit comments

Comments
 (0)