浏览代码

Bypass boost confirm modal if alt is pressed

master
blackle 7 年前
父节点
当前提交
f53fb6aa66
共有 5 个文件被更改,包括 17 次插入9 次删除
  1. +1
    -1
      app/assets/javascripts/components/components/icon_button.jsx
  2. +2
    -2
      app/assets/javascripts/components/components/status_action_bar.jsx
  3. +6
    -2
      app/assets/javascripts/components/containers/status_container.jsx
  4. +2
    -2
      app/assets/javascripts/components/features/status/components/action_bar.jsx
  5. +6
    -2
      app/assets/javascripts/components/features/status/index.jsx

+ 1
- 1
app/assets/javascripts/components/components/icon_button.jsx 查看文件

@@ -31,7 +31,7 @@ const IconButton = React.createClass({
e.preventDefault();

if (!this.props.disabled) {
this.props.onClick();
this.props.onClick(e);
}
},



+ 2
- 2
app/assets/javascripts/components/components/status_action_bar.jsx 查看文件

@@ -46,8 +46,8 @@ const StatusActionBar = React.createClass({
this.props.onFavourite(this.props.status);
},

handleReblogClick () {
this.props.onReblog(this.props.status);
handleReblogClick (e) {
this.props.onReblog(this.props.status, e);
},

handleDeleteClick () {


+ 6
- 2
app/assets/javascripts/components/containers/status_container.jsx 查看文件

@@ -42,11 +42,15 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(reblog(status));
},

onReblog (status) {
onReblog (status, e) {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
if (e.altKey) {
this.onModalReblog(status);
} else {
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
}
}
},



+ 2
- 2
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 () {


+ 6
- 2
app/assets/javascripts/components/features/status/index.jsx 查看文件

@@ -86,11 +86,15 @@ const Status = React.createClass({
this.props.dispatch(reblog(status));
},

handleReblogClick (status) {
handleReblogClick (status, e) {
if (status.get('reblogged')) {
this.props.dispatch(unreblog(status));
} else {
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
if (e.altKey) {
this.handleModalReblog(status);
} else {
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
}
}
},



正在加载...
取消
保存