Added simple click event for course selection

This commit is contained in:
Marcel 2017-12-22 13:31:34 +01:00
parent f15c62f9a8
commit 49ff9cecb6
1 changed files with 7 additions and 2 deletions

View File

@ -47,11 +47,16 @@ preprocessor.load(function(data) {
var races = processor.getRacesByYear(selectedYear);
$("#courseSelection").empty();
for(var race in races) {
$("#courseSelection").append("<li>" + races[race].raceInfo.name +" " + races[race].raceInfo.date + "</li>");
$("#courseSelection").append("<li data=\"" + races[race].raceInfo.raceId + "\">" + races[race].raceInfo.name +" " + races[race].raceInfo.date + "</li>");
}
$("#courseSelection li").click(function(event) {
var race = event.target.attributes.data.value;
$("#lineGraphBox").empty();
createLineGraph("#lineGraphBox", processor.getRace(race));
});
slyelement.obj.reload();
var raceData = races[0];
createLineGraph("#lineGraphBox", processor.getRace(974));
});
$(window).resize(function(e) {