From fc64d1d03e50003985bc9424cd575673997d1c76 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 10 Jan 2019 20:25:12 +0100 Subject: [PATCH] [Glitch] Stop gifv timeline preview explicitly when open the media gallery Port 2a113f01855ab351cfa9566f3e56ac0cdb88d5cb to glitch-soc --- app/javascript/flavours/glitch/components/media_gallery.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 10afeb2eb0..d0226bbbbc 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -71,6 +71,10 @@ class Item extends React.PureComponent { const { index, onClick } = this.props; if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { + if (this.hoverToPlay()) { + e.target.pause(); + e.target.currentTime = 0; + } e.preventDefault(); onClick(index); }