diff --git a/js/main.js b/js/main.js
index 49d791e..ef1a9fa 100644
--- a/js/main.js
+++ b/js/main.js
@@ -47,11 +47,16 @@ preprocessor.load(function(data) {
var races = processor.getRacesByYear(selectedYear);
$("#courseSelection").empty();
for(var race in races) {
- $("#courseSelection").append("
" + races[race].raceInfo.name +" " + races[race].raceInfo.date + "");
+ $("#courseSelection").append("" + races[race].raceInfo.name +" " + races[race].raceInfo.date + "");
}
+ $("#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) {