Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Allow tour startup to show more than 9 stories - Fixes #1991

ZachTRiceff22a7b63b20
diff --git a/web/css/tour.css b/web/css/tour.css
index a9f5ca458..6ba39ae22 100644
--- a/web/css/tour.css
+++ b/web/css/tour.css
@@ -117,7 +117,6 @@
.tour-start .tour-box-row {
display: flex;
flex-flow: row wrap;
- justify-content: space-between;
}
.tour-start .tour-box {
@@ -774,6 +773,10 @@
width: 200px;
}
+ .tour-start .modal-body .tour-box-float {
+ margin: 4px 4px 0 0;
+ }
+
/* .tour-complete */
.tour-complete .modal-dialog {
max-width: 572px;
diff --git a/web/js/components/tour/tour-box.js b/web/js/components/tour/tour-box.js
index ec5efb3e0..33603245d 100644
--- a/web/js/components/tour/tour-box.js
+++ b/web/js/components/tour/tour-box.js
@@ -42,8 +42,13 @@ class TourBox extends React.Component {
}
render() {
+ let floatBox = '';
+ if (this.props.storyOrder.length - (this.props.index + 1) === 0 ||
+ this.props.storyOrder.length - (this.props.index + 2) === 0) {
+ floatBox = ' tour-box-float';
+ }
return (
- <a href="#" style={this.state.styles} onMouseOver={(e) => this.onMouseOver(e)} onMouseOut={(e) => this.onMouseOut(e)} className={this.props.className} onClick={(e) => this.props.selectTour(e, this.props.story, this.props.index, this.props.storyId)}>
+ <a href="#" style={this.state.styles} onMouseOver={(e) => this.onMouseOver(e)} onMouseOut={(e) => this.onMouseOut(e)} className={this.props.className + floatBox} onClick={(e) => this.props.selectTour(e, this.props.story, this.props.index, this.props.storyId)}>
<div className="tour-box-content">
<div className="tour-box-header">
<h3 className="tour-box-title">{this.props.title}</h3>
@@ -66,6 +71,7 @@ TourBox.propTypes = {
backgroundImageHover: PropTypes.string,
className: PropTypes.string,
description: PropTypes.string,
+ storyOrder: PropTypes.array,
title: PropTypes.string
};
diff --git a/web/js/components/tour/tour-boxes.js b/web/js/components/tour/tour-boxes.js
index 1039a9133..184c3f47e 100644
--- a/web/js/components/tour/tour-boxes.js
+++ b/web/js/components/tour/tour-boxes.js
@@ -8,9 +8,9 @@ class TourBoxes extends React.Component {
return (
<div className="tour-box-container">
<div className="tour-box-row">
- {storyOrder.slice(0, 9).map(function(storyId, i) {
+ {storyOrder.map(function(storyId, i) {
const story = stories[storyId];
- return (<TourBox key={i} index={i} story={story} storyId={story.id} title={story.title} description={story.description} backgroundImage={story.backgroundImage} backgroundImageHover={story.backgroundImageHover} selectTour={selectTour} className={'tour-box ' + story.type}/>);
+ return (<TourBox key={i} index={i} story={story} storyId={story.id} storyOrder={storyOrder} title={story.title} description={story.description} backgroundImage={story.backgroundImage} backgroundImageHover={story.backgroundImageHover} selectTour={selectTour} className={'tour-box ' + story.type}/>);
})}
</div>
</div>