From 284b74472e30db0f1b1e82a4538f4bebfc0b67a5 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 20 Oct 2011 18:03:34 +0100 Subject: make the additional information fields work with js update of category dropdown --- web/js/map-OpenLayers.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 0f9974222..d754248f4 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -315,6 +315,10 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }, function(data) { $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); + eval( 'category_extras = ' + data.category_extras + ';'); + /* 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(); -- cgit v1.2.3 From 64cc9b22581f24acffbdae19ef6f06b96334135f Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 20 Oct 2011 18:53:32 +0100 Subject: remove javascript eval and send down html instead --- web/js/map-OpenLayers.js | 1 - 1 file changed, 1 deletion(-) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index d754248f4..dda50b1b9 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -315,7 +315,6 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }, function(data) { $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); - eval( 'category_extras = ' + data.category_extras + ';'); /* Need to reset this here as it gets removed when we replace the HTML for the dropdown */ $('#form_category').change( form_category_onchange ); -- cgit v1.2.3 From ba84d377dc19fe2b2c90e01ce6782d2ef6d79d14 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 20 Oct 2011 22:17:16 +0100 Subject: only add on change handler if there are open311 extra params --- web/js/map-OpenLayers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index dda50b1b9..e0b5a4436 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -317,7 +317,9 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { $('#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 ); + if ( data.has_open311 > 0 ) { + $('#form_category').change( form_category_onchange ); + } }); $('#side-form').show(); $('#side').hide(); -- cgit v1.2.3 From 8cec25a0fb0d56661f345dbeb47208ea1067acd4 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 29 Oct 2011 19:18:23 +0200 Subject: Try to get dynamic web page update to work with the stale reports. --- web/js/map-OpenLayers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index e0b5a4436..b911b7c71 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -144,9 +144,9 @@ function fixmystreet_onload() { $('#all_pins_link').click(function(e) { e.preventDefault(); fixmystreet.markers.setVisibility(true); - var welsh = 0; var texts = [ 'en', 'Include stale reports', 'Hide stale reports', + 'nb', 'Inkluder utdaterte problemer', 'Skjul utdaterte rapporter', 'cy', 'Cynnwys hen adroddiadau', 'Cuddio hen adroddiadau' ]; for (var i=0; i