read analysis initial path from the location hash
This commit is contained in:
parent
8dcefdca14
commit
50e63013aa
|
@ -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);
|
analyse = LichessAnalyse(element.querySelector('.analyse'), cfg.data, cfg.routes, cfg.i18n, lichess.analyse.onChange);
|
||||||
lichess.analyse.jump = analyse.jump;
|
lichess.analyse.jump = analyse.jump;
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,12 @@ module.exports = function(cfg, router, i18n, onChange) {
|
||||||
this.data = data({}, cfg);
|
this.data = data({}, cfg);
|
||||||
this.analyse = new analyse(this.data.game, this.data.analysis);
|
this.analyse = new analyse(this.data.game, this.data.analysis);
|
||||||
|
|
||||||
|
var initialPath = cfg.path ? treePath.read(cfg.path) : treePath.default();
|
||||||
|
|
||||||
this.vm = {
|
this.vm = {
|
||||||
flip: false,
|
flip: false,
|
||||||
path: treePath.default(),
|
path: initialPath,
|
||||||
pathStr: treePath.write(treePath.default()),
|
pathStr: treePath.write(initialPath),
|
||||||
situation: null,
|
situation: null,
|
||||||
continue: false
|
continue: false
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue