read analysis initial path from the location hash

pull/132/head
Thibault Duplessis 2014-11-08 17:34:19 +01:00
parent 8dcefdca14
commit 50e63013aa
2 changed files with 5 additions and 2 deletions

View File

@ -1904,6 +1904,7 @@ var storage = {
}
}
};
data.path = window.location.hash ? location.hash.replace(/#/, '') : '';
analyse = LichessAnalyse(element.querySelector('.analyse'), cfg.data, cfg.routes, cfg.i18n, lichess.analyse.onChange);
lichess.analyse.jump = analyse.jump;

View File

@ -11,10 +11,12 @@ module.exports = function(cfg, router, i18n, onChange) {
this.data = data({}, cfg);
this.analyse = new analyse(this.data.game, this.data.analysis);
var initialPath = cfg.path ? treePath.read(cfg.path) : treePath.default();
this.vm = {
flip: false,
path: treePath.default(),
pathStr: treePath.write(treePath.default()),
path: initialPath,
pathStr: treePath.write(initialPath),
situation: null,
continue: false
};