Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

allow df mode with anim widget while retaining anim function

Ed Plato4d748a78732c
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index b4b7c0717..866ac72ab 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -572,6 +572,7 @@ class AnimationWidget extends React.Component {
isActive,
layers,
hasCustomPalettes,
+ isDistractionFreeModeActive,
promiseImageryForTime,
selectDate,
currentDate,
@@ -626,9 +627,11 @@ class AnimationWidget extends React.Component {
onClose={onPushPause}
/>
)}
-
- {collapsed ? this.renderCollapsedWidget() : this.renderExpandedWidget()}
-
+ {!isDistractionFreeModeActive && (
+ <>
+ {collapsed ? this.renderCollapsedWidget() : this.renderExpandedWidget()}
+ </>
+ )}
</ErrorBoundary>
);
}
@@ -645,6 +648,7 @@ function mapStateToProps(state) {
config,
map,
browser,
+ ui,
} = state;
const {
startDate, endDate, speed, loop, isPlaying, isActive, gifActive,
@@ -678,6 +682,7 @@ function mapStateToProps(state) {
maxDate = appNow;
}
+ const { isDistractionFreeModeActive } = ui;
const animationIsActive = isActive
&& browser.greaterThan.small
&& lodashGet(map, 'ui.selected.frameState_')
@@ -713,6 +718,7 @@ function mapStateToProps(state) {
minDate,
maxDate,
isActive: animationIsActive,
+ isDistractionFreeModeActive,
hasFutureLayers,
hasSubdailyLayers,
subDailyMode,
@@ -851,6 +857,7 @@ AnimationWidget.propTypes = {
hasSubdailyLayers: PropTypes.bool,
interval: PropTypes.string,
isActive: PropTypes.bool,
+ isDistractionFreeModeActive: PropTypes.bool,
isGifActive: PropTypes.bool,
isPlaying: PropTypes.bool,
isRotated: PropTypes.bool,
diff --git a/web/js/modules/key-press/actions.js b/web/js/modules/key-press/actions.js
index 68de621b5..e07dc9b71 100644
--- a/web/js/modules/key-press/actions.js
+++ b/web/js/modules/key-press/actions.js
@@ -34,7 +34,8 @@ export default function keyPress(keyCode, shiftKey, ctrlOrCmdKey, isInput) {
type: ANIMATION_KEY_PRESS_ACTION,
keyCode,
});
- } else if (!isInput && !ctrlOrCmdKey && shiftKey && keyCode === 68) {
+ }
+ if (!isInput && !ctrlOrCmdKey && shiftKey && keyCode === 68) {
dispatch({ type: TOGGLE_DISTRACTION_FREE_MODE });
if (!isDistractionFreeModeActive && isOpen) {
dispatch({ type: CLOSE_MODAL });