mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Don't allow user to toggle sidebar in the walkthrough
(this would mess up all the tooltips)
This commit is contained in:
@@ -106,15 +106,18 @@ export function uiIntro(context) {
|
||||
callback(null, t('intro.graph.countrycode'));
|
||||
};
|
||||
|
||||
// Disable the sidebar resizing button
|
||||
d3_selectAll('button.sidebar-toggle').classed('disabled', true);
|
||||
|
||||
d3_selectAll('#map .layer-background').style('opacity', 1);
|
||||
|
||||
var curtain = uiCurtain();
|
||||
selection.call(curtain);
|
||||
|
||||
// store that the user started the walkthrough..
|
||||
// Store that the user started the walkthrough..
|
||||
context.storage('walkthrough_started', 'yes');
|
||||
|
||||
// restore previous walkthrough progress..
|
||||
// Restore previous walkthrough progress..
|
||||
var storedProgress = context.storage('walkthrough_progress') || '';
|
||||
var progress = storedProgress.split(';').filter(Boolean);
|
||||
|
||||
@@ -133,7 +136,7 @@ export function uiIntro(context) {
|
||||
.classed('next', true);
|
||||
}
|
||||
|
||||
// store walkthrough progress..
|
||||
// Store walkthrough progress..
|
||||
progress.push(chapter);
|
||||
context.storage('walkthrough_progress', _uniq(progress).join(';'));
|
||||
});
|
||||
@@ -141,11 +144,11 @@ export function uiIntro(context) {
|
||||
});
|
||||
|
||||
chapters[chapters.length - 1].on('startEditing', function() {
|
||||
// store walkthrough progress..
|
||||
// Store walkthrough progress..
|
||||
progress.push('startEditing');
|
||||
context.storage('walkthrough_progress', _uniq(progress).join(';'));
|
||||
|
||||
// store if walkthrough is completed..
|
||||
// Store if walkthrough is completed..
|
||||
var incomplete = _difference(chapterFlow, progress);
|
||||
if (!incomplete.length) {
|
||||
context.storage('walkthrough_completed', 'yes');
|
||||
@@ -154,6 +157,7 @@ export function uiIntro(context) {
|
||||
curtain.remove();
|
||||
navwrap.remove();
|
||||
d3_selectAll('#map .layer-background').style('opacity', opacity);
|
||||
d3_selectAll('button.sidebar-toggle').classed('disabled', false);
|
||||
if (osm) { osm.toggle(true).reset().caches(caches); }
|
||||
context.history().reset().merge(_values(baseEntities));
|
||||
context.background().baseLayerSource(background);
|
||||
|
||||
@@ -258,6 +258,9 @@ export function uiSidebar(context) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// Don't allow sidebar to toggle when the user is in the walkthrough.
|
||||
if (context.inIntro()) return;
|
||||
|
||||
var isCollapsed = selection.classed('collapsed');
|
||||
var isCollapsing = !isCollapsed;
|
||||
var xMarginProperty = textDirection === 'rtl' ? 'margin-right' : 'margin-left';
|
||||
|
||||
Reference in New Issue
Block a user