add notification when presentation changes
This commit is contained in:
parent
c7566d4b57
commit
2b9d0cccee
@ -48,10 +48,20 @@ class PresentationArea extends Component {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { currentPresentation, notify } = this.props;
|
||||
|
||||
if (prevProps.currentPresentation.name !== currentPresentation.name) {
|
||||
notify(
|
||||
`Current presentation ${currentPresentation.name}`,
|
||||
'info',
|
||||
'settings',
|
||||
);
|
||||
}
|
||||
|
||||
if (prevState.fitToWidth) {
|
||||
// When presenter is changed or slide changed we reset fitToWidth
|
||||
if ((prevProps.userIsPresenter && !this.props.userIsPresenter) ||
|
||||
(prevProps.currentSlide.id !== this.props.currentSlide.id)) {
|
||||
if ((prevProps.userIsPresenter && !this.props.userIsPresenter)
|
||||
|| (prevProps.currentSlide.id !== this.props.currentSlide.id)) {
|
||||
this.setState({
|
||||
fitToWidth: false,
|
||||
});
|
||||
@ -196,16 +206,16 @@ class PresentationArea extends Component {
|
||||
const { fitToWidth } = this.state;
|
||||
if (userIsPresenter) {
|
||||
return fitToWidth;
|
||||
} else {
|
||||
const { width, height, viewBoxWidth, viewBoxHeight } = currentSlide.calculatedData;
|
||||
const slideSizeRatio = width / height;
|
||||
const viewBoxSizeRatio = viewBoxWidth / viewBoxHeight;
|
||||
if (slideSizeRatio !== viewBoxSizeRatio) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const {
|
||||
width, height, viewBoxWidth, viewBoxHeight,
|
||||
} = currentSlide.calculatedData;
|
||||
const slideSizeRatio = width / height;
|
||||
const viewBoxSizeRatio = viewBoxWidth / viewBoxHeight;
|
||||
if (slideSizeRatio !== viewBoxSizeRatio) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
zoomChanger(incomingZoom) {
|
||||
@ -530,6 +540,7 @@ class PresentationArea extends Component {
|
||||
fitToWidth,
|
||||
} = this.state;
|
||||
|
||||
|
||||
const adjustedSizes = this.calculateSize();
|
||||
const adjustedHeight = adjustedSizes.height;
|
||||
const adjustedWidth = adjustedSizes.width;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { withTracker } from 'meteor/react-meteor-data';
|
||||
import { getSwapLayout } from '/imports/ui/components/media/service';
|
||||
import { notify } from '/imports/ui/services/notification';
|
||||
import PresentationAreaService from './service';
|
||||
import PresentationArea from './component';
|
||||
|
||||
@ -21,5 +22,7 @@ export default withTracker(({ podId }) => {
|
||||
presentationIsDownloadable,
|
||||
isFullscreen,
|
||||
mountPresentationArea: !!currentSlide,
|
||||
currentPresentation: PresentationAreaService.getCurrentPresentation(podId),
|
||||
notify,
|
||||
};
|
||||
})(PresentationAreaContainer);
|
||||
|
@ -174,4 +174,5 @@ export default {
|
||||
getMultiUserStatus,
|
||||
currentSlidHasContent,
|
||||
parseCurrentSlideContent,
|
||||
getCurrentPresentation,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user