mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-09 19:26:38 -05:00
Fix active nav link logic
This commit is contained in:
parent
0fe1549dac
commit
7f9b0ef09a
2 changed files with 3 additions and 3 deletions
2
resources/assets/sass/dashboard.scss
vendored
2
resources/assets/sass/dashboard.scss
vendored
|
@ -137,7 +137,7 @@ body {
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover, &:focus, &:active {
|
&.active, &:hover, &:focus, &:active {
|
||||||
background-color: fade-out(#000, 0.95);
|
background-color: fade-out(#000, 0.95);
|
||||||
color: $c-text;
|
color: $c-text;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="navbar navbar-expand-lg">
|
||||||
@set('current_page', preg_replace([ '/^.*\/dashboard\/?/', '/\/.*/' ], [ '', '' ], Request::url()))
|
@set('current_page', preg_replace([ '/^.*\//', '/\/.*/' ], [ '', '' ], Request::url()))
|
||||||
|
|
||||||
<a class="navbar-brand" href="{{ url('/dashboard') }}">
|
<a class="navbar-brand" href="{{ url('/dashboard') }}">
|
||||||
{{ env('APP_NAME') }} Dashboard
|
{{ env('APP_NAME') }} Dashboard
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="menu-dropdown-{{ $dropdown_id }}">
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="menu-dropdown-{{ $dropdown_id }}">
|
||||||
@foreach($menu_item['submenu'] as $submenu_item)
|
@foreach($menu_item['submenu'] as $submenu_item)
|
||||||
<a class="dropdown-item" href="{{ url('/dashboard/' . $submenu_item['type'] . '/' . $submenu_item['model']) }}">{{ $submenu_item['title'] }}</a>
|
<a class="dropdown-item {{ $current_page == $submenu_item['model'] ? 'active' : '' }}" href="{{ url('/dashboard/' . $submenu_item['type'] . '/' . $submenu_item['model']) }}">{{ $submenu_item['title'] }}</a>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue