mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
forum/components/Notification: Support external links
This commit is contained in:
committed by
Franz Liedke
parent
d1b0030292
commit
81fd986881
@@ -19,10 +19,13 @@ export default class Notification extends Component {
|
||||
const notification = this.attrs.notification;
|
||||
const href = this.href();
|
||||
|
||||
const linkAttrs = {};
|
||||
linkAttrs[href.indexOf('://') === -1 ? 'route' : 'href'] = href;
|
||||
|
||||
return (
|
||||
<a
|
||||
className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
|
||||
route={href}
|
||||
{...linkAttrs}
|
||||
onclick={this.markAsRead.bind(this)}
|
||||
>
|
||||
{!notification.isRead() &&
|
||||
|
Reference in New Issue
Block a user