mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: skip click-tracking for mentions
This commit is contained in:
parent
876c4f20b3
commit
b75720d911
@ -6,15 +6,10 @@ import { selectedText } from "discourse/lib/utilities";
|
|||||||
export function isValidLink($link) {
|
export function isValidLink($link) {
|
||||||
// Do not track:
|
// Do not track:
|
||||||
// - lightboxes
|
// - lightboxes
|
||||||
// - group mentions
|
|
||||||
// - links with disabled tracking
|
// - links with disabled tracking
|
||||||
// - category links
|
// - category links
|
||||||
// - quote back button
|
// - quote back button
|
||||||
if (
|
if ($link.is(".lightbox, .no-track-link, .hashtag, .back")) {
|
||||||
$link.is(
|
|
||||||
".lightbox, .mention, .mention-group, .no-track-link, .hashtag, .back"
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +47,11 @@ export default {
|
|||||||
const $link = $(e.currentTarget);
|
const $link = $(e.currentTarget);
|
||||||
const tracking = isValidLink($link);
|
const tracking = isValidLink($link);
|
||||||
|
|
||||||
|
// Return early for mentions and group mentions
|
||||||
|
if ($link.is(".mention, .mention-group")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($link.hasClass("attachment")) {
|
if ($link.hasClass("attachment")) {
|
||||||
// Warn the user if they cannot download the file.
|
// Warn the user if they cannot download the file.
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user