From: Holger RĂ¼prich Date: Sun, 4 Jul 2010 22:29:09 +0000 (+0800) Subject: Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable... X-Git-Tag: 1.8.3~38^2~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9d01ab564525f9112c2488ad257637593062b70d;p=jquery-ui.git Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list --- diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index a51f543c5..6cc2434e8 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('&'); },