mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 23:08:41 +00:00
feat(web/contest/backstage): hash route for tabs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
bae26f1c16
commit
6ef2c2c119
@ -35,3 +35,19 @@
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Javascript to enable link to tab
|
||||
var hash = location.hash.replace(/^#/, '');
|
||||
if (hash) {
|
||||
bootstrap.Tab.jQueryInterface.call($('.nav-tabs a[href="#' + hash + '"]'), 'show').blur();
|
||||
}
|
||||
|
||||
// Change hash for page-reload
|
||||
$('.nav-tabs a').on('shown.bs.tab', function(e) {
|
||||
window.location.hash = e.target.hash;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user