mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Handle target=_top links. Closes #3187
This commit is contained in:
parent
f242835fc2
commit
99edacebf4
1 changed files with 4 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
location,
|
location,
|
||||||
document,
|
document,
|
||||||
history,
|
history,
|
||||||
|
top,
|
||||||
} = window;
|
} = window;
|
||||||
const { hostname, href, origin } = location;
|
const { hostname, href, origin } = location;
|
||||||
const { currentScript, referrer } = document;
|
const { currentScript, referrer } = document;
|
||||||
|
|
@ -158,7 +159,9 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
return trackElement(parentElement).then(() => {
|
return trackElement(parentElement).then(() => {
|
||||||
if (!external) location.href = href;
|
if (!external) {
|
||||||
|
(target === '_top' ? top.location : location).href = href;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (parentElement.tagName === 'BUTTON') {
|
} else if (parentElement.tagName === 'BUTTON') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue