1/** add active class and stay opened when selected */
2 var url = window.location;
3
4// for sidebar menu entirely but not cover treeview
5 $('ul.nav-sidebar a').filter(function() {
6 return this.href == url;
7 }).addClass('active');
8
9// for treeview
10 $('ul.nav-treeview a').filter(function() {
11 return this.href == url;
12 }).parentsUntil(".nav-sidebar > .nav-treeview").addClass('menu-open').prev('a').addClass('active');