Auto-upgrade anchors to target _blank.

This commit is contained in:
David Russell 2017-12-05 08:35:01 +07:00
parent 7c4b04a6a2
commit a6b5ee3969

View File

@ -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()) {