diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index af69a536e..97d53dd01 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -504,6 +504,17 @@ $.extend(fixmystreet.set_up, { add_option(this); } }); + // Sort elements in place, but leave the first 'pick a category' option alone + $group_select.find("option").slice(1).sort(function(a, b) { + // 'Other' should always be at the end. + if (a.label === 'Other') { + return 1; + } + if (b.label === 'Other') { + return -1; + } + return a.label > b.label ? 1 : -1; + }).appendTo($group_select); $group_select.change(); }, |