Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Remove dateline dates when in AB #1246

Benjamin Kingf245859101e3
diff --git a/web/js/components/dateline/dateline.js b/web/js/components/dateline/dateline.js
index 0a95555a4..c4fc09439 100644
--- a/web/js/components/dateline/dateline.js
+++ b/web/js/components/dateline/dateline.js
@@ -17,7 +17,8 @@ class Line extends React.Component {
this.state = {
hovered: false,
height: props.height,
- active: true
+ active: true,
+ isTooltipActive: props.isTooltipActive
};
}
@@ -52,6 +53,7 @@ class Line extends React.Component {
* return {Void}
*/
mouseOverHidden(e) {
+ if (!this.state.isTooltipActive) return;
this.props.lineOver(
[e.clientX, e.clientY],
this.props.overlay,
@@ -68,6 +70,7 @@ class Line extends React.Component {
* return {Void}
*/
mouseOutHidden() {
+ if (!this.state.isTooltipActive) return;
this.props.lineOut(this.props.tooltip);
}
@@ -140,7 +143,8 @@ Line.propTypes = {
overlay: PropTypes.object,
style: PropTypes.object,
id: PropTypes.string,
- classes: PropTypes.string
+ classes: PropTypes.string,
+ isTooltipActive: PropTypes.bool
};
export default Line;
diff --git a/web/js/map/datelinebuilder.js b/web/js/map/datelinebuilder.js
index c2d362e5b..06bce9f8e 100644
--- a/web/js/map/datelinebuilder.js
+++ b/web/js/map/datelinebuilder.js
@@ -61,6 +61,15 @@ export function mapDateLineBuilder(models, config) {
models.date.events.on('select', function() {
updateDate(models.date[models.date.activeDate]);
});
+ if (models.compare) {
+ models.compare.events.on('toggle', function() {
+ var state = {
+ isTooltipActive: !(models.compare && models.compare.active)
+ };
+ lineRight.setState(state);
+ lineLeft.setState(state);
+ });
+ }
models.proj.events.on('select', function() {
proj = models.proj.selected.id;
});
@@ -101,7 +110,8 @@ export function mapDateLineBuilder(models, config) {
lineOut: onMouseOut,
lineX: lineX,
overlay: overlay,
- tooltip: tooltip
+ tooltip: tooltip,
+ isTooltipActive: !(models.compare && models.compare.active)
};
var component = ReactDOM.render(
React.createElement(ReactComponent, props),