diff --git a/modules/ui/intro/area.js b/modules/ui/intro/area.js index e2713bfe4..f3f0636a4 100644 --- a/modules/ui/intro/area.js +++ b/modules/ui/intro/area.js @@ -18,7 +18,7 @@ export function uiIntroArea(context, reveal) { var playground = [-85.63552, 41.94159], corner = [-85.63565411045074, 41.9417715536927]; - // context.map().centerZoom(playground, 19); + context.history().reset('initial'); context.map().zoom(19).centerEase(playground); reveal('button.add-area', @@ -104,5 +104,11 @@ export function uiIntroArea(context, reveal) { }; + chapter.restart = function() { + chapter.exit(); + chapter.enter(); + }; + + return utilRebind(chapter, dispatch, 'on'); } diff --git a/modules/ui/intro/intro.js b/modules/ui/intro/intro.js index 013d76b52..8b015f7a5 100644 --- a/modules/ui/intro/intro.js +++ b/modules/ui/intro/intro.js @@ -105,6 +105,7 @@ export function uiIntro(context) { context.connection().toggle(false).reset(); context.history().reset(); context.history().merge(d3.values(coreGraph().load(introGraph).entities)); + context.history().checkpoint('initial'); context.background().bing(); d3.selectAll('#map .layer-background').style('opacity', 1); diff --git a/modules/ui/intro/line.js b/modules/ui/intro/line.js index 00ec8cd14..f865d7dc7 100644 --- a/modules/ui/intro/line.js +++ b/modules/ui/intro/line.js @@ -35,7 +35,7 @@ export function uiIntroLine(context, reveal) { chapter.enter = function() { - // context.map().centerZoom(start, 18); + context.history().reset('initial'); context.map().zoom(18).centerEase(start); reveal('button.add-line', @@ -177,12 +177,6 @@ export function uiIntroLine(context, reveal) { }; - chapter.restart = function() { - chapter.exit(); - chapter.enter(); - }; - - chapter.exit = function() { d3.select(window).on('mousedown.intro', null, true); d3.select('#curtain').style('pointer-events', 'none'); @@ -197,5 +191,12 @@ export function uiIntroLine(context, reveal) { } }; + + chapter.restart = function() { + chapter.exit(); + chapter.enter(); + }; + + return utilRebind(chapter, dispatch, 'on'); } diff --git a/modules/ui/intro/navigation.js b/modules/ui/intro/navigation.js index 4b49623a5..c80a9c98c 100644 --- a/modules/ui/intro/navigation.js +++ b/modules/ui/intro/navigation.js @@ -25,6 +25,7 @@ export function uiIntroNavigation(context, reveal) { chapter.enter = function() { + context.history().reset('initial'); dragMap(); function dragMap() { diff --git a/modules/ui/intro/point.js b/modules/ui/intro/point.js index ae80789af..5a15816db 100644 --- a/modules/ui/intro/point.js +++ b/modules/ui/intro/point.js @@ -26,7 +26,7 @@ export function uiIntroPoint(context, reveal) { chapter.enter = function() { - // context.map().centerZoom([-85.63279, 41.94394], 19); + context.history().reset('initial'); context.map().zoom(19).centerEase([-85.63279, 41.94394]); reveal('button.add-point', @@ -178,5 +178,12 @@ export function uiIntroPoint(context, reveal) { .on('keydown.intro', null); }; + + chapter.restart = function() { + chapter.exit(); + chapter.enter(); + }; + + return utilRebind(chapter, dispatch, 'on'); }