mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
Use checkpoints to reset history to known states in walkthrough
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ export function uiIntroNavigation(context, reveal) {
|
||||
|
||||
|
||||
chapter.enter = function() {
|
||||
context.history().reset('initial');
|
||||
dragMap();
|
||||
|
||||
function dragMap() {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user