mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:54:23 +08:00
UX: If you ctrl or cmd click a user card link, don't show the card
This commit is contained in:
parent
28864e74bc
commit
60ab62b73a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user