]> cat aescling's git repositories - mastodon.git/commitdiff
Fix mention links in detailed statuses not opening in the WebUI
authorThibaut Girka <thib@sitedethib.com>
Mon, 3 Dec 2018 15:16:05 +0000 (16:16 +0100)
committerThibG <thib@sitedethib.com>
Thu, 6 Dec 2018 14:31:21 +0000 (15:31 +0100)
app/javascript/flavours/glitch/features/status/components/detailed_status.js

index 436c2df0a92ea4409d5ed3508f1fc19206105f52..6302f11af7bc967a93ff7273b98db8e67b35db1b 100644 (file)
@@ -29,7 +29,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
   };
 
   handleAccountClick = (e) => {
-    if (e.button === 0) {
+    if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {
       e.preventDefault();
       this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
     }
@@ -37,6 +37,15 @@ export default class DetailedStatus extends ImmutablePureComponent {
     e.stopPropagation();
   }
 
+  parseClick = (e, destination) => {
+    if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {
+      e.preventDefault();
+      this.context.router.history.push(destination);
+    }
+
+    e.stopPropagation();
+  }
+
   handleOpenVideo = (media, startTime) => {
     this.props.onOpenVideo(media, startTime);
   }
@@ -122,6 +131,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
           expanded={expanded}
           collapsed={false}
           onExpandedToggle={onToggleHidden}
+          parseClick={this.parseClick}
         />
 
         <div className='detailed-status__meta'>
This page took 0.043987 seconds and 4 git commands to generate.