From 8a7823f27265385c1e6b1d281d2d5ac8e1290e43 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 1 May 2015 21:53:52 +0100 Subject: [PATCH] Towards MKWS-64. Dispatch team.handleChanges() for every team represented in the new fragment. --- src/mkws-core.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 66d95fd..ce4402e 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -719,7 +719,16 @@ mkws.info("Using window.name '" + window.name + "'"); mkws.warn("hashchange: old='" + oldHash + "', new='" + location.hash + "'"); var oldStates = parse_fragment(oldHash); var newStates = parse_fragment(location.hash); - mkws.warn(mkws.$.toJSON(newStates)); oldHash = location.hash; + + for (var teamName in newStates) { + var team = mkws.teams[teamName]; + if (!team) { + alert("can't resolve team name '" + teamName + "'"); + continue; + } + + team.handleChanges(oldStates[teamName], newStates[teamName]); + } }); })(mkws.$); -- 1.7.10.4