Interactive interface for browsing global, full-resolution satellite imagery
Don't change interval until a selection has actually been made in the dialog so that timeline/animation widget don't end up in broken state
Jason Kent588e78085be7
diff --git a/web/js/components/timeline/timeline-controls/interval-timescale-change.js b/web/js/components/timeline/timeline-controls/interval-timescale-change.jsindex 15fd44c97..9570b08eb 100644--- a/web/js/components/timeline/timeline-controls/interval-timescale-change.js+++ b/web/js/components/timeline/timeline-controls/interval-timescale-change.js@@ -33,11 +33,11 @@ class TimeScaleIntervalChange extends PureComponent {}// handle click of timescale intervals- handleClickInterval = (timescale, openDialog = false) => {+ handleClickInterval = (timescale, openModal = false) => {// send props function to change timescale interval throughout appthis.setState({toolTipHovered: false- }, this.props.setTimeScaleIntervalChangeUnit(timescale, openDialog));+ }, this.props.setTimeScaleIntervalChangeUnit(timescale, openModal));}// individual linking timescale handlersdiff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.jsindex 2aa6617c7..82fa79f3e 100644--- a/web/js/containers/animation-widget.js+++ b/web/js/containers/animation-widget.js@@ -201,11 +201,16 @@ class AnimationWidget extends React.Component {* @return {void}*/- onIntervalSelect(timeScale, modalOpen) {+ onIntervalSelect(timeScale, openModal) {let delta;const { customInterval, customDelta } = this.props;const customSelected = timeScale === 'custom';+ if (openModal) {+ this.toggleCustomIntervalModal(openModal);+ return;+ }+if (customSelected && customInterval && customDelta) {timeScale = customInterval;delta = customDelta;@@ -214,7 +219,6 @@ class AnimationWidget extends React.Component {delta = 1;}this.props.onIntervalSelect(delta, timeScale, customSelected);- this.toggleCustomIntervalModal(modalOpen);}/*diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.jsindex 8e0c8eb62..1c9957461 100644--- a/web/js/containers/timeline/timeline.js+++ b/web/js/containers/timeline/timeline.js@@ -458,11 +458,16 @@ class Timeline extends React.Component {* @param {Boolean} modalOpen - is custom interval modal open* @returns {void}*/- setTimeScaleIntervalChangeUnit = (timeScale, modalOpen) => {+ setTimeScaleIntervalChangeUnit = (timeScale, openModal) => {let delta;const { customIntervalZoomLevel, customIntervalValue } = this.props;const customSelected = timeScale === 'custom';+ if (openModal) {+ this.toggleCustomIntervalModal(openModal);+ return;+ }+if (customSelected && customIntervalZoomLevel && customIntervalValue) {timeScale = customIntervalZoomLevel;delta = customIntervalValue;@@ -471,7 +476,6 @@ class Timeline extends React.Component {delta = 1;}this.props.selectInterval(delta, timeScale, customSelected);- this.toggleCustomIntervalModal(modalOpen);};/**