mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Middle clicking on search should open it in a new tab
This commit is contained in:
parent
5c583ff5bb
commit
cf7b08d034
1 changed files with 7 additions and 5 deletions
|
@ -2,6 +2,7 @@ import { createWidget } from 'discourse/widgets/widget';
|
|||
import { iconNode } from 'discourse/helpers/fa-icon';
|
||||
import { avatarImg } from 'discourse/widgets/post';
|
||||
import DiscourseURL from 'discourse/lib/url';
|
||||
import { wantsNewWindow } from 'discourse/lib/intercept-click';
|
||||
|
||||
import { h } from 'virtual-dom';
|
||||
|
||||
|
@ -11,6 +12,7 @@ const dropdown = {
|
|||
},
|
||||
|
||||
click(e) {
|
||||
if (wantsNewWindow(e)) { return; }
|
||||
e.preventDefault();
|
||||
if (!this.attrs.active) {
|
||||
this.sendWidgetAction(this.attrs.action);
|
||||
|
@ -43,7 +45,7 @@ createWidget('header-notifications', {
|
|||
}
|
||||
});
|
||||
|
||||
createWidget('user-dropdown', jQuery.extend(dropdown, {
|
||||
createWidget('user-dropdown', jQuery.extend({
|
||||
tagName: 'li.header-dropdown-toggle.current-user',
|
||||
|
||||
buildId() {
|
||||
|
@ -56,9 +58,9 @@ createWidget('user-dropdown', jQuery.extend(dropdown, {
|
|||
return h('a.icon', { attributes: { href: currentUser.get('path'), 'data-auto-route': true } },
|
||||
this.attach('header-notifications', attrs));
|
||||
}
|
||||
}));
|
||||
}, dropdown));
|
||||
|
||||
createWidget('header-dropdown', jQuery.extend(dropdown, {
|
||||
createWidget('header-dropdown', jQuery.extend({
|
||||
tagName: 'li.header-dropdown-toggle',
|
||||
|
||||
html(attrs) {
|
||||
|
@ -69,13 +71,13 @@ createWidget('header-dropdown', jQuery.extend(dropdown, {
|
|||
body.push(attrs.contents.call(this));
|
||||
}
|
||||
|
||||
return h('a.icon', { attributes: { href: '',
|
||||
return h('a.icon', { attributes: { href: attrs.href,
|
||||
'data-auto-route': true,
|
||||
title,
|
||||
'aria-label': title,
|
||||
id: attrs.iconId } }, body);
|
||||
}
|
||||
}));
|
||||
}, dropdown));
|
||||
|
||||
createWidget('header-icons', {
|
||||
tagName: 'ul.icons.clearfix',
|
||||
|
|
Loading…
Reference in a new issue