MAPG-116 attach loading animation to anchors and not to beforeunload

This commit is contained in:
Bence Pőcze 2020-06-09 23:00:07 +02:00
parent 16bcbaecbe
commit 5e28fcb64d

View File

@ -1,7 +1,15 @@
<script>
window.addEventListener('beforeunload', function (e) {
(function () {
var anchors = document.getElementsByTagName('a');
for (var i = 0; i < anchors.length; i++) {
var a = anchors[i];
if (a.target !== '_blank') {
a.onclick = function () {
document.getElementById('loading').style.visibility = 'visible';
});
}
}
}
})();
</script>
</body>
</html>