diff --git a/templates/job-order/form.onestep.html.twig b/templates/job-order/form.onestep.html.twig index b91f8b55..540f926c 100644 --- a/templates/job-order/form.onestep.html.twig +++ b/templates/job-order/form.onestep.html.twig @@ -829,7 +829,7 @@ $(function() { var hub_marker = L.marker([hub['lat'], hub['long']], { icon: icon_hub }); hubLayerGroup.addLayer(hub_marker); - hub_table += ''; + hub_table += ''; hub_table += '' + hub['name'] + ''; hub_table += '' + hub['branch'] + ''; hub_table += '' + hub['cnum'] + ''; @@ -902,6 +902,21 @@ $(function() { } }); + $(function(){ + var selectedHub = ""; + $("#hubs-table").on('click', 'tr', function() { + var id = $(this).data('id'); + + // highlight this row + $("#hubs-table").find('.m-table__row--primary').removeClass('m-table__row--primary'); + + $(this).addClass('m-table__row--primary'); + + // set hub + selectedHub = id; + }); + }); + {% if mode in ['update-processing', 'update-reassign-hub'] %} // display hub map // OSM code