DEV: removes jquery usage from intercept-click (#12600)

This commit is contained in:
Joffrey JAFFEUX 2021-04-05 11:59:58 +02:00 committed by GitHub
parent 96737b3d97
commit 8a36b91c2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,23 +21,23 @@ export default function interceptClick(e) {
return;
}
const $currentTarget = $(e.currentTarget),
href = $currentTarget.attr("href");
const currentTarget = e.currentTarget;
const href = currentTarget.href;
if (
!href ||
href === "#" ||
$currentTarget.attr("target") ||
$currentTarget.data("ember-action") ||
$currentTarget.data("auto-route") ||
$currentTarget.data("share-url") ||
$currentTarget.hasClass("widget-link") ||
$currentTarget.hasClass("raw-link") ||
$currentTarget.hasClass("mention") ||
(!$currentTarget.hasClass("d-link") &&
!$currentTarget.data("user-card") &&
$currentTarget.hasClass("ember-view")) ||
$currentTarget.hasClass("lightbox") ||
currentTarget.getAttribute("target") ||
currentTarget.dataset.emberAction ||
currentTarget.dataset.autoRoute ||
currentTarget.dataset.shareUrl ||
currentTarget.classList.contains("widget-link") ||
currentTarget.classList.contains("raw-link") ||
currentTarget.classList.contains("mention") ||
(!currentTarget.classList.contains("d-link") &&
!currentTarget.dataset.userCard &&
currentTarget.classList.contains("ember-view")) ||
currentTarget.classList.contains("lightbox") ||
href.indexOf("mailto:") === 0 ||
(href.match(/^http[s]?:\/\//i) &&
!href.match(new RegExp("^https?:\\/\\/" + window.location.hostname, "i")))