Enable navigating directly to frames via a url fragment

This commit is contained in:
Deon George 2024-01-13 13:39:25 +11:00
parent 0f9bb07d21
commit 332aa279a8
1 changed files with 14 additions and 0 deletions

View File

@ -56,5 +56,19 @@
@section('page-scripts')
<script type="text/javascript">
var basedn = {!! $bases->toJson() !!};
var subpage = window.location.hash;
$(document).ready(function() {
// Enable navigating to a page via a URL fragment, and that fragment is defined with a server-icon
var valid = Object.values($('.server-icon > a').map(function(item) {
return $(this).attr('id');
})).indexOf(subpage.substring(1));
if (valid !== -1 && subpage) {
// The click() event wont have been registered yet, so we need to delay us clicking it
setTimeout(function() { $(subpage).click(); },250);
}
});
</script>
@append