Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Don't start tour if coming in via permalink

ZachTRicec3b51dafbfc5
diff --git a/web/js/tour/ui.js b/web/js/tour/ui.js
index aeeb3e08f..e65969429 100644
--- a/web/js/tour/ui.js
+++ b/web/js/tour/ui.js
@@ -47,6 +47,11 @@ export function tourUi(models, ui, config) {
if (!util.browser.localStorage) return;
+ // Don't start tour if coming in via a permalink
+ if (window.location.search && !config.parameters.tour) {
+ return false;
+ }
+
if (hideTour && config.buildDate) {
let buildDate = new Date(config.buildDate);
let tourDate = new Date(hideTour);
@@ -74,9 +79,11 @@ export function tourUi(models, ui, config) {
};
self.selectTour = function(e, currentStory, currentStoryIndex, currentStoryId) {
+ let totalSteps = currentStory.steps;
if (e) e.preventDefault();
self.reactComponent.setState({
currentStep: 1,
+ totalSteps: totalSteps.length,
currentStoryIndex: currentStoryIndex,
modalStart: false,
modalInProgress: true,
diff --git a/web/js/ui/info.js b/web/js/ui/info.js
index 8c6502de8..97d491a41 100644
--- a/web/js/ui/info.js
+++ b/web/js/ui/info.js
@@ -54,7 +54,7 @@ export function uiInfo (ui, config) {
if (config.features.feedback) {
$menuItems.append($feedback);
}
- if (config.features.tour) {
+ if (config.features.tour && config.stories && config.storyOrder) {
$menuItems.append($tour);
}
$menuItems.append($source);