|
|
@ -214,6 +214,22 @@ class Status extends ImmutablePureComponent { |
|
|
|
this.props.onOpenVideo(media, startTime); |
|
|
|
this.props.onOpenVideo(media, startTime); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleHotkeyOpenMedia = e => { |
|
|
|
|
|
|
|
const { status, onOpenMedia, onOpenVideo } = this.props; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (status.get('media_attachments').size > 0) { |
|
|
|
|
|
|
|
if (status.getIn(['media_attachments', 0, 'type']) === 'audio') { |
|
|
|
|
|
|
|
// TODO: toggle play/paused?
|
|
|
|
|
|
|
|
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { |
|
|
|
|
|
|
|
onOpenVideo(status.getIn(['media_attachments', 0]), 0); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
onOpenMedia(status.get('media_attachments'), 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
handleHotkeyReply = e => { |
|
|
|
handleHotkeyReply = e => { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
this.props.onReply(this._properStatus(), this.context.router.history); |
|
|
|
this.props.onReply(this._properStatus(), this.context.router.history); |
|
|
@ -293,6 +309,7 @@ class Status extends ImmutablePureComponent { |
|
|
|
moveDown: this.handleHotkeyMoveDown, |
|
|
|
moveDown: this.handleHotkeyMoveDown, |
|
|
|
toggleHidden: this.handleHotkeyToggleHidden, |
|
|
|
toggleHidden: this.handleHotkeyToggleHidden, |
|
|
|
toggleSensitive: this.handleHotkeyToggleSensitive, |
|
|
|
toggleSensitive: this.handleHotkeyToggleSensitive, |
|
|
|
|
|
|
|
openMedia: this.handleHotkeyOpenMedia, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (hidden) { |
|
|
|
if (hidden) { |
|
|
|