Add new version in repository
This commit is contained in:
18
resources/views/load/url_on_tab.blade.php
Normal file
18
resources/views/load/url_on_tab.blade.php
Normal file
@@ -0,0 +1,18 @@
|
||||
@if(!defined('LOAD_URL_ON_TAB'))
|
||||
@push('js')
|
||||
<script>
|
||||
// Javascript to enable link to tab
|
||||
var url = document.location.toString();
|
||||
if (url.match('#')) {
|
||||
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
|
||||
}
|
||||
|
||||
// Change hash for page-reload
|
||||
$('.nav-tabs a').on('shown.bs.tab', function (e) {
|
||||
window.location.hash = e.target.hash;
|
||||
$(window).scrollTop(0);
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@php(define('LOAD_URL_ON_TAB', true))
|
||||
@endif
|
||||
Reference in New Issue
Block a user