Skip to content

Commit 056396d

Browse files
committed
add floating option to sortable. 'floating:true' can be used to handle horisontal sorting in lists that created empty
1 parent 116acb4 commit 056396d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/jquery.ui.sortable.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ $.widget("ui.sortable", $.ui.mouse, {
3838
scrollSpeed: 20,
3939
scope: "default",
4040
tolerance: "intersect",
41-
zIndex: 1000
41+
zIndex: 1000,
42+
floating: false
4243
},
4344
_create: function() {
4445

@@ -50,7 +51,7 @@ $.widget("ui.sortable", $.ui.mouse, {
5051
this.refresh();
5152

5253
//Let's determine if the items are being displayed horizontally
53-
this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
54+
this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : this.options.floating;
5455

5556
//Let's determine the parent's offset
5657
this.offset = this.element.offset();

0 commit comments

Comments
 (0)