From e03813cf0a6c4261fa97403e453a54ff051a6f87 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 cf3c0fc38cd2650a421f46a5f221d1d645ef6c7b 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 10afeb2eb..d0226bbbb 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); }