about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorkedama <kedama@foresdon.jp>2019-01-07 23:54:40 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-01-07 15:54:40 +0100
commitcf3c0fc38cd2650a421f46a5f221d1d645ef6c7b (patch)
tree577ab89049b9b104b2f9ab33afc072e240c39e28 /app
parent5654535728f3017615b801a1b9163d61f0cf623e (diff)
Stop gifv timeline preview explicitly when open the media gallery. (#9749)
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/components/media_gallery.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js
index ed0e4ff1b..c507920d0 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);
     }