kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Don't close media modal unless you really click outside
rodzic
4afb0a9868
commit
a5f9ff08cb
|
@ -119,6 +119,13 @@ class MediaModal extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleCloserClick = e => {
|
||||||
|
const activeSlide = document.querySelector('.media-modal .react-swipeable-view-container > div[aria-hidden="false"]');
|
||||||
|
if (e.target === activeSlide || !activeSlide.contains(e.target)) {
|
||||||
|
this.props.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { media, status, account, intl, onClose } = this.props;
|
const { media, status, account, intl, onClose } = this.props;
|
||||||
const { navigationHidden } = this.state;
|
const { navigationHidden } = this.state;
|
||||||
|
@ -236,7 +243,7 @@ class MediaModal extends ImmutablePureComponent {
|
||||||
<div
|
<div
|
||||||
className='media-modal__closer'
|
className='media-modal__closer'
|
||||||
role='presentation'
|
role='presentation'
|
||||||
onClick={onClose}
|
onClick={this.handleCloserClick}
|
||||||
>
|
>
|
||||||
<ReactSwipeableViews
|
<ReactSwipeableViews
|
||||||
style={swipeableViewsStyle}
|
style={swipeableViewsStyle}
|
||||||
|
|
|
@ -63,6 +63,11 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.audio-player {
|
||||||
|
max-width: 80vw;
|
||||||
|
max-height: 80vh;
|
||||||
|
}
|
||||||
|
|
||||||
.extended-video-player {
|
.extended-video-player {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
Ładowanie…
Reference in New Issue