Only re-create the graph if the target race id has changed
This commit is contained in:
parent
508e224883
commit
1099a1ef23
|
@ -7,6 +7,7 @@
|
|||
var slyelement = {
|
||||
obj: {},
|
||||
curRaces: {},
|
||||
curRaceId: 0,
|
||||
el: '.frame',
|
||||
options: {
|
||||
horizontal: 1,
|
||||
|
@ -62,6 +63,8 @@ preprocessor.load(function(data) {
|
|||
"</li>");
|
||||
$("#courseSelection li").click(function(event) {
|
||||
var raceI = event.currentTarget.attributes.data.value;
|
||||
if(slyelement.curRaceId == raceI){ return; }
|
||||
slyelement.curRaceId = raceI;
|
||||
var rdata = slyelement.curRaces.filter(r => r.raceInfo.raceId == raceI)[0];
|
||||
$("#lineGraphBox").empty();
|
||||
createLineGraph("#lineGraphBox", rdata);
|
||||
|
|
Loading…
Reference in New Issue