reload analysis view when a move is played - fixes #something
parent
f35857e159
commit
bcc8c749ad
|
@ -64,6 +64,7 @@ module.exports = function(cfg, saveUrl) {
|
|||
fixAll();
|
||||
|
||||
var reloadToLastPly = function() {
|
||||
loading(true);
|
||||
if (window.history.replaceState) window.history.replaceState(null, null, '#last');
|
||||
location.reload();
|
||||
};
|
||||
|
@ -141,6 +142,7 @@ module.exports = function(cfg, saveUrl) {
|
|||
loading: loading,
|
||||
onMyTurn: cfg.onMyTurn,
|
||||
findStartingWithStep: findStartingWithStep,
|
||||
playAndSave: playAndSave
|
||||
playAndSave: playAndSave,
|
||||
reloadToLastPly: reloadToLastPly
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,6 +7,10 @@ module.exports = function(send, ctrl) {
|
|||
|
||||
var anaDestsCache = {};
|
||||
|
||||
setTimeout(function() {
|
||||
send("startWatching", ctrl.data.game.id);
|
||||
}, 1000);
|
||||
|
||||
var handlers = {
|
||||
step: function(data) {
|
||||
ctrl.addStep(data.step, data.path);
|
||||
|
@ -25,6 +29,10 @@ module.exports = function(send, ctrl) {
|
|||
destsFailure: function(data) {
|
||||
console.log(data);
|
||||
clearTimeout(anaDestsTimeout);
|
||||
},
|
||||
fen: function(e) {
|
||||
if (ctrl.forecast && e.id === ctrl.data.game.id)
|
||||
ctrl.forecast.reloadToLastPly();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue