Don't close notifications dropdown if opening in a new tab

This commit is contained in:
Toby Zerner 2015-07-28 18:51:53 +09:30
parent 516569e2e9
commit fd3600ad65

View File

@ -27,7 +27,7 @@ export default class NotificationsDropdown extends Component {
<span className="Button-icon">{unread || icon('bell')}</span>
<span className="Button-label">{app.trans('core.notifications')}</span>
</a>
<div className="Dropdown-menu Dropdown-menu--right">
<div className="Dropdown-menu Dropdown-menu--right" onclick={this.menuClick.bind(this)}>
{this.showing ? NotificationList.component() : ''}
</div>
</div>
@ -41,4 +41,10 @@ export default class NotificationsDropdown extends Component {
this.showing = true;
}
}
menuClick(e) {
// Don't close the notifications dropdown if the user is opening a link in a
// new tab or window.
if (e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) e.stopPropagation();
}
}