Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

prevent left/right arrow change while dragging timeline, add condition for leftoffset coefficient used in updating timeline axis

Edward Plato758656c7bfea
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index f3d0bfbd9..689798c8c 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -643,7 +643,13 @@ class TimelineAxis extends Component {
* @returns {void}
*/
updateScaleWithOffset = (date, timeScale, draggerCheck) => {
- let leftOffsetFixedCoeff = draggerCheck.newDraggerDiff > 5 ? 0.5 : draggerCheck.newDateInThePast ? 0.25 : 0.75;
+ let leftOffsetFixedCoeff = draggerCheck.newDraggerDiff > 5
+ ? 0.5
+ : draggerCheck.newDateInThePast
+ ? !draggerCheck.withinRange
+ ? 0.5
+ : 0.25
+ : 0.75;
this.updateScale(date, timeScale, null, leftOffsetFixedCoeff);
}
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index c70dd1a08..fe7797952 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -374,7 +374,7 @@ class Timeline extends React.Component {
*/
handleKeyDown = (e) => {
// prevent left/right arrows changing date within inputs
- if (e.target.tagName !== 'INPUT' && !e.ctrlKey && !e.metaKey) {
+ if (e.target.tagName !== 'INPUT' && !e.ctrlKey && !e.metaKey && !this.state.isTimelineDragging) {
// left arrow
if (e.keyCode === 37) {
e.preventDefault();