From f1a7824791565c46c036df66503c6bdd9f802b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20R=C3=BCprich?= Date: Sun, 4 Jul 2010 15:29:09 -0700 Subject: [PATCH] Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list --- ui/jquery.ui.sortable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index ba0b283933f..f1a1deed6b6 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -409,6 +409,10 @@ $.widget("ui.sortable", $.ui.mouse, { if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); }); + if(!str.length && o.key) { + str.push(o.key + '='); + } + return str.join('&'); },