diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-17 16:02:28 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-17 16:43:22 +0100 |
commit | 17e389222fd65b15a4004df28aacdc4c45bfd443 (patch) | |
tree | e021275955ecfd3ab4f8011c947b81df14a81a7d /web | |
parent | 1d9e10e980e480196ba1a5f1a3bc450a06b78dde (diff) |
Do not fetch pins server side if JS enabled.
The page currently fetches the pins again client-side (as we don't know
the extent of the map at the server point). I realise this isn't ideal,
but should speed up the normal case quite a bit.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 7 |
1 files changed, 7 insertions, 0 deletions
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(); |