mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00: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;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
var expand = function(username, $target){
|
var expand = function(username, $target) {
|
||||||
const postId = $target.parents('article').data('post-id');
|
const postId = $target.parents('article').data('post-id');
|
||||||
self.get('controller')
|
self.get('controller')
|
||||||
.show(username, postId, $target[0])
|
.show(username, postId, $target[0])
|
||||||
@ -60,12 +60,16 @@ export default Discourse.View.extend(CleansUp, {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$('#main-outlet').on(clickDataExpand, '[data-user-card]', function(e) {
|
$('#main-outlet').on(clickDataExpand, '[data-user-card]', function(e) {
|
||||||
|
if (e.ctrlKey || e.metaKey) { return; }
|
||||||
|
|
||||||
const $target = $(e.currentTarget),
|
const $target = $(e.currentTarget),
|
||||||
username = $target.data('user-card');
|
username = $target.data('user-card');
|
||||||
return expand(username, $target);
|
return expand(username, $target);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#main-outlet').on(clickMention, 'a.mention', function(e) {
|
$('#main-outlet').on(clickMention, 'a.mention', function(e) {
|
||||||
|
if (e.ctrlKey || e.metaKey) { return; }
|
||||||
|
|
||||||
const $target = $(e.target),
|
const $target = $(e.target),
|
||||||
username = $target.text().replace(/^@/, '');
|
username = $target.text().replace(/^@/, '');
|
||||||
return expand(username, $target);
|
return expand(username, $target);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user