diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-11 20:43:56 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-11 20:43:56 +0200 |
commit | 2a7602cad449da3590cb1eac2a86a3e5cc606966 (patch) | |
tree | e315f30c6cb4b40b670e9cbd15065851d5f44a33 /app/assets/javascripts/components/features/status | |
parent | b723ee73fc7d74fd5908eb09a8f6b98e73597c2b (diff) | |
parent | 06444bf050a267da7001c2801480c5fae3e1559e (diff) |
Merge branch 'master' of https://github.com/blackle/mastodon into blackle-master
Diffstat (limited to 'app/assets/javascripts/components/features/status')
-rw-r--r-- | app/assets/javascripts/components/features/status/components/action_bar.jsx | 4 | ||||
-rw-r--r-- | app/assets/javascripts/components/features/status/index.jsx | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/app/assets/javascripts/components/features/status/components/action_bar.jsx b/app/assets/javascripts/components/features/status/components/action_bar.jsx index 2aebcd709..fdcb8b980 100644 --- a/app/assets/javascripts/components/features/status/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/status/components/action_bar.jsx @@ -37,8 +37,8 @@ const ActionBar = React.createClass({ this.props.onReply(this.props.status); }, - handleReblogClick () { - this.props.onReblog(this.props.status); + handleReblogClick (e) { + this.props.onReblog(this.props.status, e); }, handleFavouriteClick () { diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx index f98fe1b01..91302bc3f 100644 --- a/app/assets/javascripts/components/features/status/index.jsx +++ b/app/assets/javascripts/components/features/status/index.jsx @@ -38,7 +38,8 @@ const makeMapStateToProps = () => { status: getStatus(state, Number(props.params.statusId)), ancestorsIds: state.getIn(['timelines', 'ancestors', Number(props.params.statusId)]), descendantsIds: state.getIn(['timelines', 'descendants', Number(props.params.statusId)]), - me: state.getIn(['meta', 'me']) + me: state.getIn(['meta', 'me']), + boostModal: state.getIn(['meta', 'boost_modal']) }); return mapStateToProps; @@ -55,7 +56,8 @@ const Status = React.createClass({ status: ImmutablePropTypes.map, ancestorsIds: ImmutablePropTypes.list, descendantsIds: ImmutablePropTypes.list, - me: React.PropTypes.number + me: React.PropTypes.number, + boostModal: React.PropTypes.bool }, mixins: [PureRenderMixin], @@ -82,11 +84,19 @@ const Status = React.createClass({ this.props.dispatch(replyCompose(status, this.context.router)); }, - handleReblogClick (status) { + handleModalReblog (status) { + this.props.dispatch(reblog(status)); + }, + + handleReblogClick (status, e) { if (status.get('reblogged')) { this.props.dispatch(unreblog(status)); } else { - this.props.dispatch(reblog(status)); + if (e.altKey || !this.props.boostModal) { + this.handleModalReblog(status); + } else { + this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog })); + } } }, |