From b7b673fdafea0c1aa0345d2de1c19563678236d2 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Fri, 10 Jan 2020 05:53:28 +0000 Subject: [PATCH] Add rider selection to one step form. #270 --- templates/job-order/form.onestep.html.twig | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/templates/job-order/form.onestep.html.twig b/templates/job-order/form.onestep.html.twig index 9a00f9b8..86c44a81 100644 --- a/templates/job-order/form.onestep.html.twig +++ b/templates/job-order/form.onestep.html.twig @@ -930,13 +930,13 @@ $(function() { } }); - $(function(){ + $(function() { var selectedHub = ""; - $("#hubs-table").on('click', 'tr', function() { + $('#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'); + $('#hubs-table').find('.m-table__row--primary').removeClass('m-table__row--primary'); $(this).addClass('m-table__row--primary'); @@ -965,6 +965,21 @@ $(function() { }); }); + $(function() { + var selectedRider = ""; + $('#riders-table').on('click', 'tr', function() { + var id = $(this).data('id'); + + // highlight this row + $('#riders-table').find('.m-table__row--primary').removeClass('m-table__row--primary'); + + $(this).addClass('m-table__row--primary'); + + // set rider + selectedRider = id; + }); + }); + {% if mode in ['update-processing', 'update-reassign-hub'] %} // display hub map // OSM code