From 53625a9364d183bc0632b8b1c794d6904c4a0baf Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 27 Mar 2019 17:41:15 -0400 Subject: [PATCH] Fix issues with the walkthrough --- modules/presets/index.js | 9 +++++++-- modules/ui/intro/line.js | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/presets/index.js b/modules/presets/index.js index a434a20f0..4d12aacd0 100644 --- a/modules/presets/index.js +++ b/modules/presets/index.js @@ -271,7 +271,10 @@ export function presetIndex(context) { }; all.defaults = function(geometry, n) { - var rec = all.recent().matchGeometry(geometry).collection.slice(0, 4); + var rec = []; + if (!context.inIntro()) { + rec = all.recent().matchGeometry(geometry).collection.slice(0, 4); + } var def = utilArrayUniq(rec.concat(_defaults[geometry].collection)).slice(0, n - 1); return presetCollection(utilArrayUniq(rec.concat(def).concat(all.fallback(geometry)))); }; @@ -451,9 +454,11 @@ export function presetIndex(context) { }; all.setMostRecent = function(preset, geometry) { - geometry = all.fallback(geometry).id; + if (context.inIntro()) return; if (preset.searchable === false) return; + geometry = all.fallback(geometry).id; + var items = all.getRecents(); var item = all.recentMatching(preset, geometry); if (item) { diff --git a/modules/ui/intro/line.js b/modules/ui/intro/line.js index c50cf9bcc..2a3216952 100644 --- a/modules/ui/intro/line.js +++ b/modules/ui/intro/line.js @@ -20,7 +20,7 @@ export function uiIntroLine(context, reveal) { var tulipRoadStart = [-85.6297754121684, 41.95805253325314]; var tulipRoadMidpoint = [-85.62975395449628, 41.95787501510204]; var tulipRoadIntersection = [-85.62974496187628, 41.95742515554585]; - var roadCategory = context.presets().item('category-road'); + var roadCategory = context.presets().item('category-road_minor'); var residentialPreset = context.presets().item('highway/residential'); var woodRoadID = 'w525'; var woodRoadEndID = 'n2862'; @@ -241,7 +241,7 @@ export function uiIntroLine(context, reveal) { return chapter.restart(); }); - var button = d3_select('.preset-category-road .preset-list-button'); + var button = d3_select('.preset-category-road_minor .preset-list-button'); if (button.empty()) return chapter.restart(); // disallow scrolling @@ -277,7 +277,7 @@ export function uiIntroLine(context, reveal) { return chapter.restart(); }); - var subgrid = d3_select('.preset-category-road .subgrid'); + var subgrid = d3_select('.preset-category-road_minor .subgrid'); if (subgrid.empty()) return chapter.restart(); subgrid.selectAll(':not(.preset-highway-residential) .preset-list-button')