Interactive interface for browsing global, full-resolution satellite imagery
revise css selectors for timeline interval and axis zoom
Edward Plato6036f712a637
diff --git a/web/css/timeline.css b/web/css/timeline.cssindex 200191328..24c64e79f 100644--- a/web/css/timeline.css+++ b/web/css/timeline.css@@ -30,7 +30,7 @@ button:focus {width: 414px;}-#timeline-header .timeline-zoom,+#timeline-header .timeline-interval,#timeline-header .input-wrapper-hour,#timeline-header .input-time-divider,#timeline-header .input-wrapper-minute,@@ -45,7 +45,7 @@ button:focus {display: block;}-#timeline-header.subdaily .timeline-zoom,+#timeline-header.subdaily .timeline-interval,#timeline-header.subdaily .input-wrapper-hour,#timeline-header.subdaily .input-time-divider,#timeline-header.subdaily .input-wrapper-minute,@@ -450,7 +450,7 @@ button:focus {color: #7890cd !important;}-#timeline-header .timeline-zoom,+#timeline-header .timeline-interval,#zoom-btn-container-axis .wv-zoom-tooltip {display: block;width: 100%;@@ -461,12 +461,12 @@ button:focus {border-radius: 3px;}-#timeline-header #zoom-btn-container,+#timeline-header #timeline-interval-btn-container,#zoom-btn-container-axis {display: block;}-#zoom-btn-container .wv-tooltip {+#timeline-interval-btn-container .wv-tooltip {position: absolute;bottom: 100%;border-bottom: 8px solid transparent;@@ -474,14 +474,16 @@ button:focus {z-index: 10;}-#zoom-btn-container-axis .wv-zoom-tooltip {+#zoom-btn-container-axis .wv-zoom-tooltip,+#timeline-interval-btn-container .wv-zoom-tooltip {position: absolute;bottom: 100%;width: 75px;z-index: 10;}-#zoom-btn-container .wv-tooltip::after {+#zoom-btn-container-axis .wv-tooltip::after,+#timeline-interval-btn-container .wv-tooltip::after {position: absolute;top: 100%;left: 15%;@@ -492,7 +494,8 @@ button:focus {border-left: 5px solid transparent;}-.zoom-btn-active {+.zoom-btn-active,+.interval-btn-active {width: 100%;color: #ccc;font-size: 12px;@@ -506,12 +509,13 @@ button:focus {margin-top: -2px;}-.zoom-btn-active:hover {+.zoom-btn-active:hover,+.interval-btn-active:hover {background-color: #fff;color: #1a1a1a;}-.timeline-zoom .zoom-btn {+.zoom-btn, .interval-btn {display: block;clear: both;cursor: pointer;@@ -524,7 +528,7 @@ button:focus {padding: 2px 0;}-.timeline-zoom .zoom-btn:hover {+.zoom-btn:hover, .interval-btn:hover {background-color: #fff;color: #1a1a1a;}diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.jsindex 7fb1f35f4..ed9078bad 100644--- a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js@@ -58,21 +58,21 @@ class AxisTimeScaleChangeTooltip extends PureComponent {</label><spanid="zoom-years"- className="zoom-btn zoom-btn-inactive zoom-years"+ className="zoom-btn zoom-years"onClick={this.changeTimeScaleYear}>YEAR</span><spanid="zoom-months"- className="zoom-btn zoom-btn-inactive zoom-months"+ className="zoom-btn zoom-months"onClick={this.changeTimeScaleMonth}>MONTH</span><spanid="zoom-days"- className="zoom-btn zoom-btn-inactive zoom-days"+ className="zoom-btn zoom-days"onClick={this.changeTimeScaleDay}>DAY@@ -81,14 +81,14 @@ class AxisTimeScaleChangeTooltip extends PureComponent {<React.Fragment><spanid="zoom-hours"- className="zoom-btn zoom-btn-inactive zoom-hours"+ className="zoom-btn zoom-hours"onClick={this.changeTimeScaleHour}>HOUR</span><spanid="zoom-minutes"- className="zoom-btn zoom-btn-inactive zoom-minutes"+ className="zoom-btn zoom-minutes"onClick={this.changeTimeScaleMinute}>MINUTEdiff --git a/web/js/components/timeline/timeline-controls/date-change-arrows.js b/web/js/components/timeline/timeline-controls/date-change-arrows.jsindex 7c4f5877c..877410aa1 100644--- a/web/js/components/timeline/timeline-controls/date-change-arrows.js+++ b/web/js/components/timeline/timeline-controls/date-change-arrows.js@@ -58,7 +58,7 @@ class DateChangeArrows extends PureComponent {onMouseUp={this.leftArrowUp}onMouseLeave={this.leftArrowUp}>- <svg id="timeline-svg" width="24" height="30">+ <svg width="24" height="30"><pathd="M 10.240764,0 24,15 10.240764,30 0,30 13.759236,15 0,0 10.240764,0 z"className="arrow"diff --git a/web/js/components/timeline/timeline-controls/interval-timescale-change.js b/web/js/components/timeline/timeline-controls/interval-timescale-change.jsindex 79df04730..85acaefd0 100644--- a/web/js/components/timeline/timeline-controls/interval-timescale-change.js+++ b/web/js/components/timeline/timeline-controls/interval-timescale-change.js@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';import PropTypes from 'prop-types';/*- * Change timescale interval (zoom level) by selecting from default timescales+ * Change timescale interval (time unit) by selecting from default timescales* and custom (if available) in tooltip visible upon hover of current timescale* above the LEFT/RIGHT increment arrows (ex: hover over '1 day' for example)*@@ -18,49 +18,49 @@ class TimeScaleIntervalChange extends PureComponent {};}- // Zoom select tooltip on+ // Interval select tooltip ontoolTipHoverOn = () => {this.setState({toolTipHovered: true});}- // Zoom select tooltip off+ // Interval select tooltip offtoolTipHoverOff = () => {this.setState({toolTipHovered: false});}- // handle click zoom of timescale intervals- handleClickZoom = (timescale, openDialog = false) => {- // send props function to change timescale zoom level throughout app+ // handle click of timescale intervals+ handleClickInterval = (timescale, openDialog = false) => {+ // send props function to change timescale interval throughout appthis.setState({toolTipHovered: false}, this.props.setTimeScaleIntervalChangeUnit(timescale, openDialog));}// individual linking timescale handlers- handleClickZoomYear = () => {- this.handleClickZoom('year');+ handleClickIntervalYear = () => {+ this.handleClickInterval('year');}- handleClickZoomMonth = () => {- this.handleClickZoom('month');+ handleClickIntervalMonth = () => {+ this.handleClickInterval('month');}- handleClickZoomDay= () => {- this.handleClickZoom('day');+ handleClickIntervalDay= () => {+ this.handleClickInterval('day');}- handleClickZoomHour = () => {- this.handleClickZoom('hour');+ handleClickIntervalHour = () => {+ this.handleClickInterval('hour');}- handleClickZoomMinute = () => {- this.handleClickZoom('minute');+ handleClickIntervalMinute = () => {+ this.handleClickInterval('minute');}- handleClickZoomCustom = () => {- this.handleClickZoom('custom');+ handleClickIntervalCustom = () => {+ this.handleClickInterval('custom');}- handleClickZoomCustomStatic = () => {- this.handleClickZoom('custom', true);+ handleClickIntervalCustomStatic = () => {+ this.handleClickInterval('custom', true);}// set custom text for custom interval@@ -82,10 +82,10 @@ class TimeScaleIntervalChange extends PureComponent {timeScaleChangeUnit,customSelected} = this.props;- if (customDelta && timeScaleChangeUnit) {- if (customSelected && customDelta !== 1 && this.state.customIntervalText === 'Custom') {- this.setCustomIntervalText();- } else if (customSelected && (customDelta !== prevProps.customDelta || timeScaleChangeUnit !== prevProps.timeScaleChangeUnit)) {+ if (customSelected && customDelta && timeScaleChangeUnit) {+ const didCustomDeltaChange = customDelta !== prevProps.customDelta;+ const didTimeScaleChangeUnitChange = timeScaleChangeUnit !== prevProps.timeScaleChangeUnit;+ if (didCustomDeltaChange || didTimeScaleChangeUnitChange) {this.setCustomIntervalText();}}@@ -98,11 +98,12 @@ class TimeScaleIntervalChange extends PureComponent {} = this.state;let {customSelected,+ hasSubdailyLayers,timeScaleChangeUnit} = this.props;return (<React.Fragment>- <div id="zoom-btn-container"+ <div id="timeline-interval-btn-container"className="noselect"onMouseEnter={this.toolTipHoverOn}onMouseLeave={this.toolTipHoverOff}@@ -110,7 +111,7 @@ class TimeScaleIntervalChange extends PureComponent {{/* timeScale display */}<spanid="current-interval"- className={`zoom-btn zoom-btn-active${customSelected ? ' custom-interval-text' : ''}`}+ className={`interval-btn interval-btn-active${customSelected ? ' custom-interval-text' : ''}`}>{customSelected ? customIntervalText : 1 + ' ' + timeScaleChangeUnit}</span>@@ -119,54 +120,58 @@ class TimeScaleIntervalChange extends PureComponent {<div className="wv-tooltip"style={{ display: toolTipHovered ? 'block' : 'none' }}>- <div id="timeline-zoom" className="timeline-zoom">+ <div id="timeline-interval" className="timeline-interval"><span- id="zoom-years"- className="zoom-btn zoom-btn-inactive zoom-years"- onClick={this.handleClickZoomYear}+ id="interval-years"+ className="interval-btn interval-years"+ onClick={this.handleClickIntervalYear}>Year</span><span- id="zoom-months"- className="zoom-btn zoom-btn-inactive zoom-months"- onClick={this.handleClickZoomMonth}+ id="interval-months"+ className="interval-btn interval-months"+ onClick={this.handleClickIntervalMonth}>Month</span><span- id="zoom-days"- className="zoom-btn zoom-btn-inactive zoom-days"- onClick={this.handleClickZoomDay}+ id="interval-days"+ className="interval-btn interval-days"+ onClick={this.handleClickIntervalDay}>Day</span>+ {hasSubdailyLayers ? (+ <React.Fragment>+ <span+ id="interval-hours"+ className="interval-btn interval-hours"+ onClick={this.handleClickIntervalHour}+ >+ Hour+ </span>+ <span+ id="interval-minutes"+ className="interval-btn interval-minutes"+ onClick={this.handleClickIntervalMinute}+ >+ Minute+ </span>+ </React.Fragment>+ ) : null}<span- id="zoom-hours"- className="zoom-btn zoom-btn-inactive zoom-hours"- onClick={this.handleClickZoomHour}- >- Hour- </span>- <span- id="zoom-minutes"- className="zoom-btn zoom-btn-inactive zoom-minutes"- onClick={this.handleClickZoomMinute}- >- Minute- </span>- <span- id="zoom-custom"- className="zoom-btn zoom-btn-inactive zoom-custom custom-interval-text"+ id="interval-custom"+ className="interval-btn interval-custom custom-interval-text"style={{ display: customIntervalText === 'Custom' ? 'none' : 'block' }}- onClick={this.handleClickZoomCustom}+ onClick={this.handleClickIntervalCustom}>{customIntervalText}</span><span- id="zoom-custom-static"- className="zoom-btn zoom-btn-inactive zoom-custom custom-interval-text"- onClick={this.handleClickZoomCustomStatic}+ id="interval-custom-static"+ className="interval-btn interval-custom custom-interval-text"+ onClick={this.handleClickIntervalCustomStatic}>Custom</span>@@ -182,6 +187,7 @@ TimeScaleIntervalChange.propTypes = {customDelta: PropTypes.number,customIntervalZoomLevel: PropTypes.string,customSelected: PropTypes.bool,+ hasSubdailyLayers: PropTypes.bool,setTimeScaleIntervalChangeUnit: PropTypes.func,timeScaleChangeUnit: PropTypes.string};diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.jsindex a1cb758af..c70dd1a08 100644--- a/web/js/containers/timeline/timeline.js+++ b/web/js/containers/timeline/timeline.js@@ -2,6 +2,7 @@ import React from 'react';import PropTypes from 'prop-types';import { connect } from 'react-redux';import moment from 'moment';+import googleTagManager from 'googleTagManager';import util from '../../util/util';import ErrorBoundary from '../../containers/error-boundary';@@ -461,6 +462,9 @@ class Timeline extends React.Component {if (this.props.isAnimationWidgetOpen) {this.props.closeAnimation();} else {+ googleTagManager.pushEvent({+ event: 'GIF_setup_animation_button'+ });this.props.openAnimation();}};@@ -888,6 +892,7 @@ class Timeline extends React.Component {customSelected={customSelected}customDelta={customIntervalValue}timeScaleChangeUnit={timeScaleChangeUnit}+ hasSubdailyLayers={hasSubdailyLayers}/><DateChangeArrowsleftArrowDown={this.throttleDecrementDate}