From 3700dca455e552ff5846949b972f4be6cf7337dd Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 4 Aug 2011 00:21:42 +0100 Subject: yet another attempt at storing the service detail information this time we sort as we store so we don't need to do this every time we display the information --- web/js/fixmystreet.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'web/js') diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 3c5c56454..9fa0f948b 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -63,13 +63,19 @@ $(function(){ if ( category_extras[this.options[ this.selectedIndex ].text] ) { var fields = category_extras[this.options[ this.selectedIndex ].text]; $('

Additional information

').appendTo('#category_meta'); - fields.sort( function(a,b) { return a.order - b.order } ); for ( var i in fields) { - var field = ''; var meta = fields[i]; - field = '
'; + var field = '
'; field += ''; - field += ''; + if ( meta.values ) { + field += ''; + } else { + field += ''; + } field += '
'; $( field ).appendTo('#category_meta'); } -- cgit v1.2.3