From 8cf5c174cdf216c114e6e3c2a8e202cc49a7b012 Mon Sep 17 00:00:00 2001 From: kedama Date: Mon, 7 Jan 2019 23:54:40 +0900 Subject: [PATCH] Stop gifv timeline preview explicitly when open the media gallery. (#9749) --- app/javascript/mastodon/components/media_gallery.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index ed0e4ff1b6f866..c507920d0ee34a 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -51,6 +51,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); }