diff --git a/js/src/forum/components/NotificationsDropdown.js b/js/src/forum/components/NotificationsDropdown.js index b930b0520..735d9ae8d 100644 --- a/js/src/forum/components/NotificationsDropdown.js +++ b/js/src/forum/components/NotificationsDropdown.js @@ -3,21 +3,21 @@ import icon from '../../common/helpers/icon'; import NotificationList from './NotificationList'; export default class NotificationsDropdown extends Dropdown { - static initProps(props) { - props.className = props.className || 'NotificationsDropdown'; - props.buttonClassName = props.buttonClassName || 'Button Button--flat'; - props.menuClassName = props.menuClassName || 'Dropdown-menu--right'; - props.label = props.label || app.translator.trans('core.forum.notifications.tooltip'); - props.icon = props.icon || 'fas fa-bell'; + initAttrs(attrs) { + attrs.className = attrs.className || 'NotificationsDropdown'; + attrs.buttonClassName = attrs.buttonClassName || 'Button Button--flat'; + attrs.menuClassName = attrs.menuClassName || 'Dropdown-menu--right'; + attrs.label = attrs.label || app.translator.trans('core.forum.notifications.tooltip'); + attrs.icon = attrs.icon || 'fas fa-bell'; - super.initProps(props); + super.initAttrs(attrs); } getButton() { const newNotifications = this.getNewCount(); const vdom = super.getButton(); - vdom.attrs.title = this.props.label; + vdom.attrs.title = this.attrs.label; vdom.attrs.className += newNotifications ? ' new' : ''; vdom.attrs.onclick = this.onclick.bind(this); @@ -29,16 +29,16 @@ export default class NotificationsDropdown extends Dropdown { const unread = this.getUnreadCount(); return [ - icon(this.props.icon, { className: 'Button-icon' }), + icon(this.attrs.icon, { className: 'Button-icon' }), unread ? {unread} : '', - {this.props.label}, + {this.attrs.label}, ]; } getMenu() { return ( -
- {this.showing ? NotificationList.component({ state: this.props.state }) : ''} +
+ {this.showing ? NotificationList.component({ state: this.attrs.state }) : ''}
); } @@ -47,7 +47,7 @@ export default class NotificationsDropdown extends Dropdown { if (app.drawer.isOpen()) { this.goToRoute(); } else { - this.props.state.load(); + this.attrs.state.load(); } }