diff options
author | Struan Donald <struan@exo.org.uk> | 2011-10-20 20:35:21 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-10-20 20:35:21 +0100 |
commit | 6923018a0bdf4a996b2cf15a56ba887009e66aab (patch) | |
tree | 4b5d029faa478c3c6c3422a4eaf9a670560f7f69 /web/js | |
parent | e452ace27c4a13557a0ec878e74ebf19d1d1a347 (diff) | |
parent | 64cc9b22581f24acffbdae19ef6f06b96334135f (diff) |
Merge branch 'open311-consumer'
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/fixmystreet.js | 20 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 6a11a5832..dc180151c 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -3,6 +3,23 @@ * FixMyStreet JavaScript */ +function form_category_onchange() { + $.getJSON('/report/new/category_extras', { + area_id: 2649, + category: this.options[ this.selectedIndex ].text, + }, function(data) { + if ( data.category_extra ) { + if ( $('#category_meta').size() ) { + $('#category_meta').html( data.category_extra); + } else { + $('#form_category_row').after( data.category_extra ); + } + } else { + $('#category_meta').empty(); + } + }); +} + $(function(){ $('html').removeClass('no-js').addClass('js'); @@ -59,6 +76,9 @@ $(function(){ timer = window.setTimeout(email_alert_close, 2000); }); + + $('#form_category').change( form_category_onchange ); + // Geolocation if (geo_position_js.init()) { $('#postcodeForm').append('<p id="geolocate_para">Or <a href="#" id="geolocate_link">locate me automatically</a>').css({ "padding-bottom": "0.5em" }); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 0f9974222..dda50b1b9 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -315,6 +315,9 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }, function(data) { $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); + /* Need to reset this here as it gets removed when we replace + the HTML for the dropdown */ + $('#form_category').change( form_category_onchange ); }); $('#side-form').show(); $('#side').hide(); |