From 8b59ce9183273b43f119b2cf95f4f41dca296bf0 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 25 Jan 2018 20:31:12 +0530 Subject: [PATCH] FIX: CTRL+mouse-left-click / CMD+mouse-left-click or mouse-middle-click should open link in new tab --- app/assets/javascripts/discourse/lib/click-track.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/click-track.js.es6 b/app/assets/javascripts/discourse/lib/click-track.js.es6 index 6247973d451..13845062a4e 100644 --- a/app/assets/javascripts/discourse/lib/click-track.js.es6 +++ b/app/assets/javascripts/discourse/lib/click-track.js.es6 @@ -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);