Interactive interface for browsing global, full-resolution satellite imagery
Restart tour when explore worldview button clicked #1797
Benjamin King93b472308767
diff --git a/web/js/app.js b/web/js/app.jsindex abf7bf97c..6160fa01e 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -92,12 +92,13 @@ class App extends React.Component {document.removeEventListener('keypress', this.handleKeyPress);}render() {- let isAnimationWidgetActive = this.props.state.animation.isActive;+ const { isAnimationWidgetActive, isTourActive } = this.props;+return (<div className="wv-content" id="wv-content" data-role="content"><Toolbar /><Sidebar />- <Tour />+ {isTourActive ? <Tour /> : null}<div id="layer-modal" className="layer-modal" /><div id="layer-settings-modal" /><div id="wv-map" className="wv-map" />@@ -162,6 +163,8 @@ class App extends React.Component {function mapStateToProps(state, ownProps) {return {state: state,+ isAnimationWidgetActive: state.animation.isActive,+ isTourActive: state.tour.active,config: state.config,parameters: state.parameters,models: ownProps.models,@@ -182,6 +185,8 @@ export default connect(mapDispatchToProps)(App);App.propTypes = {+ isAnimationWidgetActive: PropTypes.bool,+ isTourActive: PropTypes.bool,keyPressAction: PropTypes.func,mapMouseEvents: PropTypes.object,parameters: PropTypes.object,diff --git a/web/js/containers/info.js b/web/js/containers/info.jsindex a1d24ed1c..97690bfc1 100644--- a/web/js/containers/info.js+++ b/web/js/containers/info.js@@ -13,7 +13,7 @@ import { onClickFeedback } from '../modules/feedback/util';import { addToLocalStorage } from '../modules/notifications/util';import { initFeedback } from '../modules/feedback/actions';-import { startTour } from '../modules/tour/actions';+import { startTour, endTour } from '../modules/tour/actions';import { notificationsSeen } from '../modules/notifications/actions';import util from '../util/util';import Notifications from '../containers/notifications';@@ -46,7 +46,8 @@ class InfoList extends Component {aboutClick,notifications,config,- startTour+ startTour,+ isTourActive} = this.props;let arr = [{@@ -90,7 +91,7 @@ class InfoList extends Component {iconClass: 'ui-icon fa fa-truck fa-fw',id: 'start_tour_info_item',onClick: () => {- startTour();+ startTour(isTourActive);googleTagManager.pushEvent({event: 'tour_start_button'});@@ -115,6 +116,7 @@ function mapStateToProps(state) {return {feedbackIsInitiated: isInitiated,+ isTourActive: state.tour.active,notifications: state.notifications,config: state.config,models: state.models@@ -141,8 +143,15 @@ const mapDispatchToProps = dispatch => ({}));},- startTour: () => {- dispatch(startTour());+ startTour: isTourActive => {+ if (isTourActive) {+ dispatch(endTour());+ setTimeout(() => {+ dispatch(startTour());+ }, 100);+ } else {+ dispatch(startTour());+ }},aboutClick: () => {if (util.browser.small) {@@ -169,6 +178,7 @@ InfoList.propTypes = {aboutClick: PropTypes.func,config: PropTypes.object,feedbackIsInitiated: PropTypes.bool,+ isTourActive: PropTypes.bool,models: PropTypes.object,notificationClick: PropTypes.func,notifications: PropTypes.object,