mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Auto-upgrade anchors to target _blank.
This commit is contained in:
parent
7c4b04a6a2
commit
a6b5ee3969
|
@ -108,6 +108,8 @@
|
|||
|
||||
Reveal.addEventListener('ready', function(evt) {
|
||||
|
||||
upgradeAnchors();
|
||||
|
||||
if (evt.indexh === 0 && evt.indexv === 0) {
|
||||
pushHelpNotification();
|
||||
} else {
|
||||
|
@ -180,6 +182,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
function upgradeAnchors() {
|
||||
Array.from(document.getElementsByTagName('a')).forEach($link => {
|
||||
if ($link.hostname !== window.location.hostname) {
|
||||
$link.setAttribute('target', '_blank');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@if(ssm.remoteControlEnabled()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user