mirror of
https://github.com/flarum/core.git
synced 2025-08-08 17:36:38 +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 notification = this.attrs.notification;
|
||||||
const href = this.href();
|
const href = this.href();
|
||||||
|
|
||||||
|
const linkAttrs = {};
|
||||||
|
linkAttrs[href.indexOf('://') === -1 ? 'route' : 'href'] = href;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
|
className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
|
||||||
route={href}
|
{...linkAttrs}
|
||||||
onclick={this.markAsRead.bind(this)}
|
onclick={this.markAsRead.bind(this)}
|
||||||
>
|
>
|
||||||
{!notification.isRead() &&
|
{!notification.isRead() &&
|
||||||
|
Reference in New Issue
Block a user