mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Correctly intercept <a href target="_self"
(#22077)
`_self` is the default, so we should treat it the same as having no value specified. This fixes navigation to links like `/my/...` in custom sidebar links.
This commit is contained in:
parent
9bbfb6e171
commit
0790e9f4f1
@ -24,11 +24,13 @@ export default function interceptClick(e) {
|
|||||||
|
|
||||||
const currentTarget = e.currentTarget;
|
const currentTarget = e.currentTarget;
|
||||||
const href = currentTarget.getAttribute("href");
|
const href = currentTarget.getAttribute("href");
|
||||||
|
const linkTarget = currentTarget.getAttribute("target");
|
||||||
|
const targettingOtherFrame = linkTarget && linkTarget !== "_self";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!href ||
|
!href ||
|
||||||
href.startsWith("#") ||
|
href.startsWith("#") ||
|
||||||
currentTarget.getAttribute("target") ||
|
targettingOtherFrame ||
|
||||||
currentTarget.dataset.emberAction ||
|
currentTarget.dataset.emberAction ||
|
||||||
currentTarget.dataset.autoRoute ||
|
currentTarget.dataset.autoRoute ||
|
||||||
currentTarget.dataset.shareUrl ||
|
currentTarget.dataset.shareUrl ||
|
||||||
|
Loading…
Reference in New Issue
Block a user