Skip to content

Commit

Permalink
Timeline: open event attributes in new window (when signaled)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman committed Jun 14, 2023
1 parent e9a08df commit 95ceec5
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions packages/cbioportal-clinical-timeline/src/TimelineTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,39 @@ export const EventTooltipContent: React.FunctionComponent<{
<div>
<table className={'table table-condensed'}>
<tbody>
{_.map(attributes, (att: any) => {
{_.map(attributes, (attr: any) => {
return (
<tr>
<td>{att.key.replace(/_/g, ' ')}</td>
<td>{attr.key.replace(/_/g, ' ')}</td>
<td>
<ReactMarkdown
allowedElements={['p', 'a']}
linkTarget={'_blank'}
components={{
a: ({ node, ...props }) => (
<OurPopup {...props} />
),
a: ({ node, ...props }) => {
if (
/:blank$/.test(props.href!)
) {
return (
<a
href={props.href?.replace(
/:blank$/,
''
)}
target={'_blank'}
>
{props.children}
</a>
);
} else {
return (
<OurPopup {...props} />
);
}
},
}}
>
{att.value}
{attr.value}
</ReactMarkdown>
</td>
</tr>
Expand Down

0 comments on commit 95ceec5

Please sign in to comment.