Skip to content

Commit 9d01ab5

Browse files
holgerscottgonzalez
authored andcommitted
Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list
1 parent 325a262 commit 9d01ab5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/jquery.ui.sortable.js

+4
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ $.widget("ui.sortable", $.ui.mouse, {
409409
if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
410410
});
411411

412+
if(!str.length && o.key) {
413+
str.push(o.key + '=');
414+
}
415+
412416
return str.join('&');
413417

414418
},

0 commit comments

Comments
 (0)