diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 2 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 4a82c67cc..b872084ff 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -249,6 +249,8 @@ sub map_features : Private { $c->stash->{all_pins} = $all_pins; my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age; + return if $c->get_param('js'); # JS will request the same (or more) data client side + my ( $on_map_all, $on_map_list, $nearby, $distance ) = FixMyStreet::Map::map_features( $c, interval => $interval, %$extra, diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 291455aa7..49f14f0de 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -256,6 +256,13 @@ $.extend(fixmystreet.set_up, { document.createElement('img').src = '/i/pin-green.png'; } + $('a[href*="around"]').each(function() { + this.href = this.href + (this.href.indexOf('?') > -1 ? '&js=1' : '?js=1'); + }); + $('form[action*="around"]').each(function() { + $('<input type="hidden" name="js" value="1">').prependTo(this); + }); + // Focus on postcode box on front page $('#pc').focus(); |