Skip to content

Commit 4ffe0e0

Browse files
bug fix, selection not reseting when switching payloads
1 parent ba5caed commit 4ffe0e0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 87
2+
# version 88
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

js/tracker.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function followVehicle(index) {
280280
vehicles[follow_vehicle].follow = true;
281281
panTo(index);
282282

283-
updateGraph(index);
283+
updateGraph(index, true);
284284
}
285285
}
286286

@@ -793,11 +793,13 @@ function addPosition(position) {
793793
return;
794794
}
795795

796-
function updateGraph(idx) {
796+
function updateGraph(idx, reset_selection) {
797797
if(!plot) return;
798798

799799
if(polyMarker) polyMarker.setPosition(null);
800800

801+
if(reset_selection) delete plot_options.xaxis;
802+
801803
// replot graph, with this vehicle data, and this vehicles yaxes config
802804
plot = $.plot(plot_holder, vehicles[idx].graph_data, $.extend(false, plot_options, {yaxes:vehicles[idx].graph_yaxes}));
803805
}
@@ -1095,7 +1097,7 @@ function update(response) {
10951097
}
10961098

10971099
// update graph is current vehicles is followed
1098-
if(follow_vehicle != -1 && vehicles[follow_vehicle].graph_data_updated) updateGraph(follow_vehicle);
1100+
if(follow_vehicle != -1 && vehicles[follow_vehicle].graph_data_updated) updateGraph(follow_vehicle, false);
10991101

11001102
// store in localStorage
11011103
offline.set('positions', lastPositions);

0 commit comments

Comments
 (0)