diff options
author | Dave Arter <davea@mysociety.org> | 2017-11-24 12:21:50 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-11-24 15:02:23 +0000 |
commit | 583af99116f35138868063fb61fc49686a770986 (patch) | |
tree | 9e78b44729ce3588402e544088aa7f3d75c8aa5f /web/js/front.js | |
parent | e4e245caf847b4fa8866ccecd0abf7b8d6a516a8 (diff) |
Add js=1 to links to /around from the front page
The location disambiguation page uses the frontpage JavaScript and has
lots of links pointing to /around, so the code should make sure those
links include the `js` parameter.
Diffstat (limited to 'web/js/front.js')
-rw-r--r-- | web/js/front.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/js/front.js b/web/js/front.js index d2c814490..8471972d4 100644 --- a/web/js/front.js +++ b/web/js/front.js @@ -10,4 +10,9 @@ document.getElementById('pc').focus(); el.value = 1; form.insertBefore(el, form.firstChild); } + var around_links = document.querySelectorAll('a[href*="around"]'); + for (i=0; i<around_links.length; i++) { + var link = around_links[i]; + link.href = link.href + (link.href.indexOf('?') > -1 ? '&js=1' : '?js=1'); + } })(); |