Add selection of hub. #270
This commit is contained in:
parent
603919667f
commit
0771f2b8d0
1 changed files with 16 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue