FIX: CTRL+mouse-left-click / CMD+mouse-left-click or mouse-middle-click should open link in new tab

This commit is contained in:
Arpit Jalan 2018-01-25 20:31:12 +05:30
parent 6750ff6873
commit 8b59ce9183
1 changed files with 2 additions and 1 deletions

View File

@ -129,7 +129,8 @@ export default {
}
// Otherwise, use a custom URL with a redirect
if (Discourse.User.currentProp('external_links_in_new_tab')) {
// consider CTRL+mouse-left-click / CMD+mouse-left-click or mouse-middle-click as well
if (Discourse.User.currentProp('external_links_in_new_tab') || ((e.ctrlKey || e.metaKey) && (e.which === 1)) || (e.which === 2)) {
window.open(destUrl, '_blank').focus();
} else {
DiscourseURL.redirectTo(destUrl);