Skip to content

Commit f49bdff

Browse files
fixed graph selection reseting unexpectedly
fix #62
1 parent d3bee94 commit f49bdff

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

js/plot_config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ $(plot_holder).bind("dblclick", function () {
136136
}
137137
}
138138

139-
updateGraph(follow_vehicle);
139+
updateGraph(follow_vehicle, false);
140140
});
141141

142142
// limit range after selection
@@ -152,5 +152,5 @@ $(plot_holder).bind("plotselected", function (event, ranges) {
152152
}
153153
});
154154

155-
updateGraph(follow_vehicle);
155+
updateGraph(follow_vehicle, false);
156156
});

js/tracker.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ function addPosition(position) {
16761676
};
16771677

16781678
// deep copy yaxes config for graph
1679-
$.each($.extend(false, plot_options.yaxes, {}), function(k,v) { vehicle_info.graph_yaxes.push(v); });
1679+
$.each($.extend(plot_options.yaxes, {}), function(k,v) { vehicle_info.graph_yaxes.push(v); });
16801680

16811681
// nyan mod
16821682
if(nyan_mode && vehicle_info.vehicle_type == "balloon") {
@@ -1845,9 +1845,8 @@ function addPosition(position) {
18451845
function updateGraph(vcallsign, reset_selection) {
18461846
if(!plot || !plot_open) return;
18471847

1848-
18491848
if(reset_selection) {
1850-
delete plot_options.xaxis;
1849+
if(vcallsign !== null) delete plot_options.xaxis;
18511850

18521851
if(polyMarker) polyMarker.setPosition(null);
18531852
plot_crosshair_locked = false;
@@ -1880,7 +1879,7 @@ function updateGraph(vcallsign, reset_selection) {
18801879
}
18811880

18821881
// replot graph, with this vehicle data, and this vehicles yaxes config
1883-
plot = $.plot(plot_holder, series, $.extend(false, plot_options, {yaxes:vehicles[vcallsign].graph_yaxes}));
1882+
plot = $.plot(plot_holder, series, $.extend(plot_options, {yaxes:vehicles[vcallsign].graph_yaxes}));
18841883
graph_vehicle = follow_vehicle;
18851884

18861885
vehicles[vcallsign].graph_data_updated = false;

0 commit comments

Comments
 (0)