about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorNeil Moore <dar13.dev@gmail.com>2019-05-26 07:48:45 -0400
committermultiple creatures <dev@multiple-creature.party>2019-11-19 15:32:39 -0600
commitdf29ca91bd1d7a01a6696e143c19b6c9f51ef4bc (patch)
treebba3aa6e3ec0f57df5f9ea23d42b8668dd9a2295 /app
parenta79c9d86d1edd99bf351f47efe950179490a728e (diff)
Create new click handler for status__expand area in status (#10837)
This click handler only activates on left-click, resolving #10798.
This matches behavior in status_content.js, as added in #536
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/components/status.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js
index fb118f328..8bd4e948b 100644
--- a/app/javascript/mastodon/components/status.js
+++ b/app/javascript/mastodon/components/status.js
@@ -166,6 +166,17 @@ class Status extends ImmutablePureComponent {
     this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);
   }
 
+  handleExpandClick = (e) => {
+    if (e.button === 0) {
+      if (!this.context.router) {
+        return;
+      }
+
+      const { status } = this.props;
+      this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);
+    }
+  }
+
   handleAccountClick = (e) => {
     if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
       const id = e.currentTarget.getAttribute('data-id');
@@ -394,7 +405,7 @@ class Status extends ImmutablePureComponent {
           {prepend}
 
           <div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted, read: unread === false })} data-id={status.get('id')}>
-            <div className='status__expand' onClick={this.handleClick} role='presentation' />
+            <div className='status__expand' onClick={this.handleExpandClick} role='presentation' />
             <div className='status__info'>
               <a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener'><RelativeTimestamp timestamp={status.get('created_at')} /></a>