Skip to content

Commit be4c0fc

Browse files
committed
Draggable: clean up whitespace in scroll option
1 parent e9efbc2 commit be4c0fc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ui/draggable.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -838,19 +838,19 @@ $.ui.plugin.add("draggable", "scroll", {
838838
document = i.document[ 0 ];
839839

840840
if ( i.scrollParent[ 0 ] !== document && i.scrollParent[ 0 ].tagName !== "HTML" ) {
841-
if (!o.axis || o.axis !== "x") {
842-
if ((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
843-
i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
844-
} else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
845-
i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
841+
if ( !o.axis || o.axis !== "x" ) {
842+
if ( ( i.overflowOffset.top + i.scrollParent[ 0 ].offsetHeight ) - event.pageY < o.scrollSensitivity ) {
843+
i.scrollParent[ 0 ].scrollTop = scrolled = i.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
844+
} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
845+
i.scrollParent[ 0 ].scrollTop = scrolled = i.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
846846
}
847847
}
848848

849-
if (!o.axis || o.axis !== "y") {
850-
if ((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
851-
i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
852-
} else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
853-
i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
849+
if ( !o.axis || o.axis !== "y" ) {
850+
if ( ( i.overflowOffset.left + i.scrollParent[ 0 ].offsetWidth ) - event.pageX < o.scrollSensitivity ) {
851+
i.scrollParent[ 0 ].scrollLeft = scrolled = i.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
852+
} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
853+
i.scrollParent[ 0 ].scrollLeft = scrolled = i.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
854854
}
855855
}
856856

0 commit comments

Comments
 (0)