"Open the tab defined in the URL" compatibility

- Better compatibility by not using ```
- If page is scrollable, prevent jumping down past the tabs
This commit is contained in:
Guillaume 2019-01-26 18:13:36 +01:00 committed by GitHub
parent 45f68cbf39
commit 3de1d3113b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View File

@ -288,4 +288,4 @@ $(document).ready(function() {
$('a[href="'+ window.location.hash +'"]').tab('show'); $('a[href="'+ window.location.hash +'"]').tab('show');
window.scrollTo(0); window.scrollTo(0);
}); });
</script> </script>

View File

@ -345,6 +345,9 @@
} }
}); });
// Open the tab defined in the URL
$('a[href="'+ window.location.hash +'"]').tab('show');
window.scrollTo(0);
}); });
</script> </script>
@ -536,10 +539,4 @@
</script> </script>
</div> </div>
<?php echo Bootstrap::formClose(); ?> <?php echo Bootstrap::formClose(); ?>
<script>
// Open the tab defined in the URL
const anchor = window.location.hash;
$(`a[href="${anchor}"]`).tab('show');
</script>