Add selection of hub. #270

This commit is contained in:
Korina Cordero 2020-01-09 08:12:12 +00:00
parent 603919667f
commit 0771f2b8d0

View file

@ -829,7 +829,7 @@ $(function() {
var hub_marker = L.marker([hub['lat'], hub['long']], { icon: icon_hub });
hubLayerGroup.addLayer(hub_marker);
hub_table += '<tr>';
hub_table += '<tr data-id=' + hub['id'] + '>';
hub_table += '<td>' + hub['name'] + '</td>';
hub_table += '<td>' + hub['branch'] + '</td>';
hub_table += '<td>' + hub['cnum'] + '</td>';
@ -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