1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Simplify notification markup

This commit is contained in:
Toby Zerner
2015-09-04 12:12:48 +09:30
parent 3aa94e1b10
commit 423aad22de

View File

@@ -19,18 +19,21 @@ export default class Notification extends Component {
const href = this.href(); const href = this.href();
return ( return (
<div className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')} <a className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
onclick={this.markAsRead.bind(this)}> href={href}
<a href={href} config={href.indexOf('://') === -1 ? m.route : undefined}> config={function(element, isInitialized) {
{avatar(notification.sender())} if (href.indexOf('://') === -1) m.route.apply(this, arguments);
{icon(this.icon(), {className: 'Notification-icon'})}
<span className="Notification-content">{this.content()}</span> if (!isInitialized) $(element).click(this.markAsRead.bind(this));
{humanTime(notification.time())} }}>
<div className="Notification-excerpt"> {avatar(notification.sender())}
{this.excerpt()} {icon(this.icon(), {className: 'Notification-icon'})}
</div> <span className="Notification-content">{this.content()}</span>
</a> {humanTime(notification.time())}
</div> <div className="Notification-excerpt">
{this.excerpt()}
</div>
</a>
); );
} }