update analysis charts on load

This commit is contained in:
Thibault Duplessis 2014-11-08 17:20:55 +01:00
parent 1f41a9a540
commit 8dcefdca14
2 changed files with 9 additions and 3 deletions

View file

@ -1859,8 +1859,11 @@ var storage = {
point.select(false);
});
};
var chart, point, adv, title;
analyse = LichessAnalyse(element.querySelector('.analyse'), cfg.data, cfg.routes, cfg.i18n, function(fen, path) {
var lastFen, lastPath;
lichess.analyse.onChange = function(fen, path) {
lastFen = fen = fen || lastFen;
lastPath = path = path || lastPath;
var chart, point, adv, title;
$inputFen.val(fen);
if ($advChart.length) {
chart = $advChart.highcharts();
@ -1900,7 +1903,8 @@ var storage = {
}
}
}
});
};
analyse = LichessAnalyse(element.querySelector('.analyse'), cfg.data, cfg.routes, cfg.i18n, lichess.analyse.onChange);
lichess.analyse.jump = analyse.jump;
$('.underboard_content', element).appendTo($('.underboard .center', element)).show();

View file

@ -129,6 +129,7 @@ $(function() {
gridLineWidth: 0
}
}));
lichess.analyse.onChange();
});
$.renderMoveTimesChart = function() {
@ -211,6 +212,7 @@ $(function() {
}
}));
});
lichess.analyse.onChange();
};
if ($('#movetimes_chart:visible:not(.rendered)').length) $.renderMoveTimesChart();
});