From 87071d9e8133daf60f5c253fdc4250086e342143 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 8 Apr 2018 23:15:25 +0200 Subject: [Glitch] Improved media modal Port 4e929b2d173fa22b722c58c0e9f8223eb4f44b0e to glitch-soc --- .../flavours/glitch/components/extended_video_player.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/javascript/flavours/glitch/components/extended_video_player.js') diff --git a/app/javascript/flavours/glitch/components/extended_video_player.js b/app/javascript/flavours/glitch/components/extended_video_player.js index f8bd067e8..9e2f6835a 100644 --- a/app/javascript/flavours/glitch/components/extended_video_player.js +++ b/app/javascript/flavours/glitch/components/extended_video_player.js @@ -11,6 +11,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { time: PropTypes.number, controls: PropTypes.bool.isRequired, muted: PropTypes.bool.isRequired, + onClick: PropTypes.func, }; handleLoadedData = () => { @@ -31,6 +32,12 @@ export default class ExtendedVideoPlayer extends React.PureComponent { this.video = c; } + handleClick = e => { + e.stopPropagation(); + const handler = this.props.onClick; + if (handler) handler(); + } + render () { const { src, muted, controls, alt } = this.props; @@ -46,6 +53,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { muted={muted} controls={controls} loop={!controls} + onClick={this.handleClick} /> ); -- cgit