about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorblackle <isabelle@blackle-mori.com>2017-04-11 08:34:14 -0400
committerblackle <isabelle@blackle-mori.com>2017-04-11 08:34:14 -0400
commitf53fb6aa660834074bbbffac5b1fe5ea0cc85edf (patch)
tree61f9076b3cfee49c31b33700af92eebf492658e2 /app
parent01e5447e3582787bf2370b9a483963953bdbb075 (diff)
Bypass boost confirm modal if alt is pressed
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/components/components/icon_button.jsx2
-rw-r--r--app/assets/javascripts/components/components/status_action_bar.jsx4
-rw-r--r--app/assets/javascripts/components/containers/status_container.jsx8
-rw-r--r--app/assets/javascripts/components/features/status/components/action_bar.jsx4
-rw-r--r--app/assets/javascripts/components/features/status/index.jsx8
5 files changed, 17 insertions, 9 deletions
diff --git a/app/assets/javascripts/components/components/icon_button.jsx b/app/assets/javascripts/components/components/icon_button.jsx
index a08b1159b..33835f9a0 100644
--- a/app/assets/javascripts/components/components/icon_button.jsx
+++ b/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);
     }
   },
 
diff --git a/app/assets/javascripts/components/components/status_action_bar.jsx b/app/assets/javascripts/components/components/status_action_bar.jsx
index 4ebb76ea7..02424e77c 100644
--- a/app/assets/javascripts/components/components/status_action_bar.jsx
+++ b/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 () {
diff --git a/app/assets/javascripts/components/containers/status_container.jsx b/app/assets/javascripts/components/containers/status_container.jsx
index 918fb91a0..02746cc79 100644
--- a/app/assets/javascripts/components/containers/status_container.jsx
+++ b/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 }));
+      }
     }
   },
 
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 8b5019b57..94ccaf535 100644
--- a/app/assets/javascripts/components/features/status/index.jsx
+++ b/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 }));
+      }
     }
   },