forked from cybrespace/mastodon
Bypass boost confirm modal if alt is pressed
This commit is contained in:
parent
01e5447e35
commit
f53fb6aa66
|
@ -31,7 +31,7 @@ const IconButton = React.createClass({
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onClick();
|
this.props.onClick(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ const StatusActionBar = React.createClass({
|
||||||
this.props.onFavourite(this.props.status);
|
this.props.onFavourite(this.props.status);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleReblogClick () {
|
handleReblogClick (e) {
|
||||||
this.props.onReblog(this.props.status);
|
this.props.onReblog(this.props.status, e);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteClick () {
|
handleDeleteClick () {
|
||||||
|
|
|
@ -42,12 +42,16 @@ const mapDispatchToProps = (dispatch) => ({
|
||||||
dispatch(reblog(status));
|
dispatch(reblog(status));
|
||||||
},
|
},
|
||||||
|
|
||||||
onReblog (status) {
|
onReblog (status, e) {
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
dispatch(unreblog(status));
|
dispatch(unreblog(status));
|
||||||
|
} else {
|
||||||
|
if (e.altKey) {
|
||||||
|
this.onModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
|
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onFavourite (status) {
|
onFavourite (status) {
|
||||||
|
|
|
@ -37,8 +37,8 @@ const ActionBar = React.createClass({
|
||||||
this.props.onReply(this.props.status);
|
this.props.onReply(this.props.status);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleReblogClick () {
|
handleReblogClick (e) {
|
||||||
this.props.onReblog(this.props.status);
|
this.props.onReblog(this.props.status, e);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFavouriteClick () {
|
handleFavouriteClick () {
|
||||||
|
|
|
@ -86,12 +86,16 @@ const Status = React.createClass({
|
||||||
this.props.dispatch(reblog(status));
|
this.props.dispatch(reblog(status));
|
||||||
},
|
},
|
||||||
|
|
||||||
handleReblogClick (status) {
|
handleReblogClick (status, e) {
|
||||||
if (status.get('reblogged')) {
|
if (status.get('reblogged')) {
|
||||||
this.props.dispatch(unreblog(status));
|
this.props.dispatch(unreblog(status));
|
||||||
|
} else {
|
||||||
|
if (e.altKey) {
|
||||||
|
this.handleModalReblog(status);
|
||||||
} else {
|
} else {
|
||||||
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
|
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteClick (status) {
|
handleDeleteClick (status) {
|
||||||
|
|
Loading…
Reference in New Issue