"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

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