Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Switcher should be disabled while walkthrough is active #4401

Closed
bhousel opened this issue Oct 6, 2017 · 2 comments · Fixed by #4402
Closed

Source Switcher should be disabled while walkthrough is active #4401

bhousel opened this issue Oct 6, 2017 · 2 comments · Fixed by #4402
Labels
bug A bug - let's fix this! good first issue Best for first-time contributors. No experience necessary!

Comments

@bhousel
Copy link
Member

bhousel commented Oct 6, 2017

I know that the source switcher is mostly for local iD installs for debugging, but clicking it while the walkthrough is active throws away the walkthrough graph.

@bhousel bhousel added bug A bug - let's fix this! good first issue Best for first-time contributors. No experience necessary! Hacktoberfest labels Oct 6, 2017
@bhousel
Copy link
Member Author

bhousel commented Oct 6, 2017

For anyone who wants to work on this - it's real easy!
Just add a if (context.inIntro()) return; right after the d3_event.preventDefault(); line.
This will make the button do nothing if the tutorial is active..

function click() {
d3_event.preventDefault();
if (context.history().hasChanges() &&
!window.confirm(t('source_switch.lose_changes'))) return;
var live = d3_select(this)
.classed('live');
context.history().clearSaved();
context.connection().switch(live ? keys[1] : keys[0]);
context.enter(modeBrowse(context));
context.flush();
d3_select(this)
.text(live ? t('source_switch.dev') : t('source_switch.live'))
.classed('live', !live);
}

mauzzr pushed a commit to mauzzr/iD that referenced this issue Oct 6, 2017
Closes openstreetmap#4401 -- fixed as proposed in the issue's comments
@mauzzr
Copy link

mauzzr commented Oct 6, 2017

I'm on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this! good first issue Best for first-time contributors. No experience necessary!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants