]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Stop gifv timeline preview explicitly when open the media gallery
authorThibaut Girka <thib@sitedethib.com>
Thu, 10 Jan 2019 19:25:12 +0000 (20:25 +0100)
committerThibaut Girka <thib@sitedethib.com>
Thu, 10 Jan 2019 20:00:33 +0000 (21:00 +0100)
Port cf3c0fc38cd2650a421f46a5f221d1d645ef6c7b to glitch-soc

app/javascript/flavours/glitch/components/media_gallery.js

index 10afeb2eb0a3d3e14a4a9e7dc6a186b2cfec04f0..d0226bbbbc11fbaf37eae8b004f7b7a40d1100bd 100644 (file)
@@ -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);
     }