Commit 7d4585d2 authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - script for active menu. ok (2)

parent c93f95b0
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
@section('Limitless::SidebarContent') @section('Limitless::SidebarContent')
@Limitless::NavigationStart @Limitless::NavigationStart
@Limitless::NavigationMenuItem(['url' => '', 'target' => '_self', 'icon' => 'icon-home2', 'title' => 'Home']) @Limitless::NavigationMenuItem(['url' => '/', 'target' => '_self', 'icon' => 'icon-home2', 'title' => 'Home'])
@Limitless::NavigationMenuStart(['title' => 'Elements', 'icon' => 'icon-grid5']) @Limitless::NavigationMenuStart(['title' => 'Elements', 'icon' => 'icon-grid5'])
@Limitless::NavigationMenuItem(['url' => '?page=Element.Example', 'target' => '_self', 'icon' => 'icon-exclamation', 'title' => 'Example']) @Limitless::NavigationMenuItem(['url' => '?page=Element.Example', 'target' => '_self', 'icon' => 'icon-exclamation', 'title' => 'Example'])
@Limitless::NavigationMenuItem(['url' => '?page=Element.Alert', 'target' => '_self', 'icon' => 'icon-bubble-notification', 'title' => 'Alert']) @Limitless::NavigationMenuItem(['url' => '?page=Element.Alert', 'target' => '_self', 'icon' => 'icon-bubble-notification', 'title' => 'Alert'])
......
$(document).ready(function() { $(document).ready(function() {
let currentWindowPath = window.location.search;
console.log(currentWindowPath);
console.log('-----------------------------');
$('.sidebar-content .nav-link').each(function () { $('.sidebar-content .nav-link').each(function () {
if (window.location.search == $(this).attr('href')) {
if(currentWindowPath === '') currentWindowPath = '/';
console.log($(this).attr('href'));
if (currentWindowPath == $(this).attr('href')) {
$(this).addClass('active') $(this).addClass('active')
$(this).parents('.nav-item-submenu').addClass('nav-item-open'); $(this).parents('.nav-item-submenu').addClass('nav-item-open');
$(this).parents('.nav-group-sub').css("display", "block"); $(this).parents('.nav-group-sub').css("display", "block");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment