"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:12:15 +01:00 committed by GitHub
parent a1a7a7fd38
commit 45f68cbf39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,11 +283,9 @@ $(document).ready(function() {
form.hide().appendTo("body").submit(); form.hide().appendTo("body").submit();
}); });
// Open the tab defined in the URL
$('a[href="'+ window.location.hash +'"]').tab('show');
window.scrollTo(0);
}); });
</script> </script>
<script>
// Open the tab defined in the URL
const anchor = window.location.hash;
$(`a[href="${anchor}"]`).tab('show');
</script>