Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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 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
Owner

Thanks, landed in b8b0c52.

Scott González scottgonzalez closed this April 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 24, 2012
Jason Moon Sortable: update placeholder when axis is x or y. Fixed #8274 - place…
…holder doesn't move when dragging outside of container element
c9ad237
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  ui/jquery.ui.sortable.js
4  ui/jquery.ui.sortable.js
@@ -467,8 +467,8 @@ $.widget("ui.sortable", $.ui.mouse, {
467 467
 
468 468
 	_intersectsWithPointer: function(item) {
469 469
 
470  
-		var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
471  
-			isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
  470
+		var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
  471
+			isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
472 472
 			isOverElement = isOverElementHeight && isOverElementWidth,
473 473
 			verticalDirection = this._getDragVerticalDirection(),
474 474
 			horizontalDirection = this._getDragHorizontalDirection();
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.