FIX: Middle clicking on user notifications

This commit is contained in:
Robin Ward 2016-04-26 13:19:22 -04:00
parent 33b192ba61
commit 821103cad5
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D

View File

@ -96,8 +96,6 @@ createWidget('notification-item', {
},
click(e) {
if (e.isDefaultPrevented() || e.shiftKey || e.metaKey || e.ctrlKey) { return; }
e.preventDefault();
this.attrs.set('read', true);
const id = this.attrs.id;
@ -105,6 +103,9 @@ createWidget('notification-item', {
if (document && document.cookie) {
document.cookie = `cn=${id}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
}
if (e.isDefaultPrevented() || e.shiftKey || e.metaKey || e.ctrlKey || e.button !== 0) { return; }
e.preventDefault();
this.sendWidgetEvent('linkClicked');
DiscourseURL.routeTo(this.url());
}