aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.sortable.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-04-02 19:42:19 +0200
committerFelix Nagel <info@felixnagel.com>2013-04-02 19:42:19 +0200
commit73c7342bc4418a902bf021c89e7d2c43172e004e (patch)
tree1c4d622cc91c2cfb76a0ee1e5977ac2b03799551 /ui/jquery.ui.sortable.js
parent26c528a4a3b712760792c62b005307a2fe0f6ba6 (diff)
parent09b3533910e887377fc87126608db1ded06f38f6 (diff)
downloadjquery-ui-73c7342bc4418a902bf021c89e7d2c43172e004e.tar.gz
jquery-ui-73c7342bc4418a902bf021c89e7d2c43172e004e.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.sortable.js')
-rw-r--r--ui/jquery.ui.sortable.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 642d5d947..7b145159e 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -535,7 +535,9 @@ $.widget("ui.sortable", $.ui.mouse, {
b = t + item.height,
dyClick = this.offset.click.top,
dxClick = this.offset.click.left,
- isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
if ( this.options.tolerance === "pointer" ||
this.options.forcePointerForContainers ||
@@ -750,15 +752,16 @@ $.widget("ui.sortable", $.ui.mouse, {
element: function() {
var nodeName = that.currentItem[0].nodeName.toLowerCase(),
- element = $( that.document[0].createElement( nodeName ) )
+ element = $( "<" + nodeName + ">", that.document[0] )
.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
.removeClass("ui-sortable-helper");
if ( nodeName === "tr" ) {
- // Use a high colspan to force the td to expand the full
- // width of the table (browsers are smart enough to
- // handle this properly)
- element.append( "<td colspan='99'>&#160;</td>" );
+ that.currentItem.children().each(function() {
+ $( "<td>&#160;</td>", that.document[0] )
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+ .appendTo( element );
+ });
} else if ( nodeName === "img" ) {
element.attr( "src", that.currentItem.attr( "src" ) );
}