aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/tfl/js.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/cobrands/tfl/js.js')
-rw-r--r--web/cobrands/tfl/js.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/cobrands/tfl/js.js b/web/cobrands/tfl/js.js
index 613c07231..c80036370 100644
--- a/web/cobrands/tfl/js.js
+++ b/web/cobrands/tfl/js.js
@@ -3,6 +3,20 @@
translation_strings.name.validName = 'Please enter your full name, Transport for London needs this information – if you do not wish your name to be shown on the site, untick the box below';
translation_strings.upload_default_message = 'Drag photo here to upload or <u>browse files</u>';
+fixmystreet.tfl_link_update = function() {
+ var lat = document.getElementById('fixmystreet.latitude');
+ if (!lat) {
+ return;
+ }
+ lat = lat.value;
+ var lon = document.getElementById('fixmystreet.longitude').value;
+ $('.js-not-tfl-link').each(function(){
+ this.search = 'latitude=' + lat + '&longitude=' + lon;
+ });
+};
+$(fixmystreet).on('maps:update_pin', fixmystreet.tfl_link_update);
+$(fixmystreet).on('report_new:category_change', fixmystreet.tfl_link_update);
+
$(function() {
function update_category_group_label() {
var group = $("#report_inspect_form select#category option:selected").closest("optgroup").attr('label');