From 60ab62b73a5cb73f99a0c2e1db36c80cd8bb2d21 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 30 Mar 2015 12:08:16 -0400 Subject: [PATCH] UX: If you ctrl or cmd click a user card link, don't show the card --- app/assets/javascripts/discourse/views/user-card.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/user-card.js.es6 b/app/assets/javascripts/discourse/views/user-card.js.es6 index 62721328136..13dbd898cd2 100644 --- a/app/assets/javascripts/discourse/views/user-card.js.es6 +++ b/app/assets/javascripts/discourse/views/user-card.js.es6 @@ -47,7 +47,7 @@ export default Discourse.View.extend(CleansUp, { return true; }); - var expand = function(username, $target){ + var expand = function(username, $target) { const postId = $target.parents('article').data('post-id'); self.get('controller') .show(username, postId, $target[0]) @@ -60,12 +60,16 @@ export default Discourse.View.extend(CleansUp, { }; $('#main-outlet').on(clickDataExpand, '[data-user-card]', function(e) { + if (e.ctrlKey || e.metaKey) { return; } + const $target = $(e.currentTarget), username = $target.data('user-card'); return expand(username, $target); }); $('#main-outlet').on(clickMention, 'a.mention', function(e) { + if (e.ctrlKey || e.metaKey) { return; } + const $target = $(e.target), username = $target.text().replace(/^@/, ''); return expand(username, $target);