about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/media_gallery.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-10 20:25:12 +0100
committerThibaut Girka <thib@sitedethib.com>2019-01-10 21:00:33 +0100
commite03813cf0a6c4261fa97403e453a54ff051a6f87 (patch)
tree78b866d19708b55169d75c934c6143723e170e95 /app/javascript/flavours/glitch/components/media_gallery.js
parent147f4f9fd2163a2f6ebb1e4bb12aae9146835431 (diff)
[Glitch] Stop gifv timeline preview explicitly when open the media gallery
Port cf3c0fc38cd2650a421f46a5f221d1d645ef6c7b to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/components/media_gallery.js')
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js4
1 files changed, 4 insertions, 0 deletions
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);
     }