Skip to content

Commit

Permalink
Stop gifv timeline preview explicitly when open the media gallery. (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
kedamaDQ authored and hiyuki2578 committed Oct 2, 2019
1 parent 7aa0a81 commit 8cf5c17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/javascript/mastodon/components/media_gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8cf5c17

Please sign in to comment.