Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

When options.axis is "x" or "y", allow drag to rearrange placeholder element even when outside of the container element. #640

Closed
wants to merge 1 commit into from

2 participants

Jason Moon Scott González
Jason Moon

You can see this fix in-action here:
http://jsfiddle.net/MoonScript/vLyfU/7/show/
(Full Fiddle source: http://jsfiddle.net/MoonScript/vLyfU/7/)

Once you grab an item and start dragging up and down, move your mouse to the left as you drag, and you'll see that the yellow placeholder element will move up and down along with your mouse.

You can see how it currently works to compare:
http://jsfiddle.net/MoonScript/vLyfU/show/

Jason Moon MoonScript Sortable: update placeholder when axis is x or y. Fixed #8274 - place…
…holder doesn't move when dragging outside of container element
c9ad237
Scott González

Thanks, landed in b8b0c52.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 25, 2012
  1. Jason Moon

    Sortable: update placeholder when axis is x or y. Fixed #8274 - place…

    MoonScript authored
    …holder doesn't move when dragging outside of container element
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.sortable.js
4 ui/jquery.ui.sortable.js
View
@@ -467,8 +467,8 @@ $.widget("ui.sortable", $.ui.mouse, {
_intersectsWithPointer: function(item) {
- var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
- isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+ var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+ isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
isOverElement = isOverElementHeight && isOverElementWidth,
verticalDirection = this._getDragVerticalDirection(),
horizontalDirection = this._getDragHorizontalDirection();
Something went wrong with that request. Please try again.