Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions web/js/containers/animation-widget/animation-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
changeEndDate,
changeStartAndEndDate,
toggleAnimationCollapse,
toggleAnimationAutoplay,
} from '../../modules/animation/actions';
import usePrevious from '../../util/customHooks';
import DesktopAnimationWidget from './desktop-animation-widget';
Expand Down Expand Up @@ -76,7 +75,6 @@ function AnimationWidget (props) {
onPushPause,
onPushPlay,
onSlide,
onToggleAnimationAutoplay,
onToggleAnimationCollapse,
onUpdateEndDate,
onUpdateStartDate,
Expand Down Expand Up @@ -109,19 +107,14 @@ function AnimationWidget (props) {
onToggleAnimationCollapse();
};

const toggleAutoplay = () => {
onToggleAnimationAutoplay();
};

// component did mount
useEffect(() => {
if (isEmbedModeActive) {
setWidgetPosition({ x: 10, y: 0 });
toggleCollapse();
}
if (!isPlaying && autoplay && !isKioskModeActive) {
if (!isPlaying && autoplay) {
onPushPlay();
toggleAutoplay();
}
}, []);

Expand Down Expand Up @@ -313,6 +306,7 @@ function AnimationWidget (props) {
: (
<DesktopAnimationWidget
animationCustomModalOpen={animationCustomModalOpen}
autoplay={autoplay}
customModalType={customModalType}
isDistractionFreeModeActive={isDistractionFreeModeActive}
endDate={endDate}
Expand Down Expand Up @@ -517,9 +511,6 @@ const mapDispatchToProps = (dispatch) => ({
onToggleAnimationCollapse: () => {
dispatch(toggleAnimationCollapse());
},
onToggleAnimationAutoplay: () => {
dispatch(toggleAnimationAutoplay());
},
});

AnimationWidget.propTypes = {
Expand Down Expand Up @@ -551,7 +542,6 @@ AnimationWidget.propTypes = {
minDate: PropTypes.object,
numberOfFrames: PropTypes.number,
onToggleAnimationCollapse: PropTypes.func,
onToggleAnimationAutoplay: PropTypes.func,
onClose: PropTypes.func,
onPushLoop: PropTypes.func,
onPushPause: PropTypes.func,
Expand Down
10 changes: 7 additions & 3 deletions web/js/containers/animation-widget/desktop-animation-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import CustomIntervalSelector from '../../components/timeline/custom-interval-se
function DesktopAnimationWidget(props) {
const {
animationCustomModalOpen,
autoplay,
customModalType,
endDate,
handleDragStart,
hasSubdailyLayers,
interval,
isDistractionFreeModeActive,
isPlaying,
looping,
maxDate,
Expand Down Expand Up @@ -47,6 +49,8 @@ function DesktopAnimationWidget(props) {
onSlide(speed);
};

const hideWidget = autoplay || isDistractionFreeModeActive ? 'd-none' : '';

return (
<Draggable
bounds="body"
Expand All @@ -56,7 +60,7 @@ function DesktopAnimationWidget(props) {
onDrag={onExpandedDrag}
onStart={handleDragStart}
>
<div className="wv-animation-widget-wrapper">
<div className={`wv-animation-widget-wrapper ${hideWidget}`}>
<div
id="wv-animation-widget"
className={`wv-animation-widget${subDailyMode ? ' subdaily' : ''}`}
Expand Down Expand Up @@ -101,7 +105,6 @@ function DesktopAnimationWidget(props) {
/>
</div>
<span className="wv-slider-label mt-1">

{speed}
{' '}
{sliderLabel}
Expand All @@ -122,7 +125,6 @@ function DesktopAnimationWidget(props) {
subDailyMode={subDailyMode}
isDisabled={isPlaying}
/>

<FontAwesomeIcon icon="chevron-down" className="wv-minimize" onClick={toggleCollapse} />
<FontAwesomeIcon icon="times" className="wv-close" onClick={onClose} />
</div>
Expand All @@ -133,11 +135,13 @@ function DesktopAnimationWidget(props) {

DesktopAnimationWidget.propTypes = {
animationCustomModalOpen: PropTypes.bool,
autoplay: PropTypes.bool,
customModalType: PropTypes.object,
endDate: PropTypes.object,
handleDragStart: PropTypes.func,
hasSubdailyLayers: PropTypes.bool,
interval: PropTypes.string,
isDistractionFreeModeActive: PropTypes.bool,
isPlaying: PropTypes.bool,
looping: PropTypes.bool,
maxDate: PropTypes.object,
Expand Down