3
Good morning, gentlemen. First of all, excuse my question, I’m not a web programmer and I need to do something I’m a layman.
I am trying to give a "simple" maintenance on a Dashboard here from the company where I work, in it we have a bar on the left side that you can see below:
This left bar by default is expanded, but when clicked on the icon marked with red it reduces to the following way:
The problem: I need to make the side menu by default come in reduced form, and not expanded as it currently comes
Can identify what calls the "function" (I don’t know what it’s called) that reduces the menu is
<div class="nav toggle">
<a id="menu_toggle"><i class="fa fa-bars"></i></a>
</div>
So I went to a. js file that was in the project and found the following code:
$(function () {
$('#sidebar-menu li ul').slideUp();
$('#sidebar-menu li').removeClass('active');
$('#sidebar-menu li').click(function () {
if ($(this).is('.active')) {
$(this).removeClass('active');
$('ul', this).slideUp();
$(this).removeClass('nv');
$(this).addClass('vn');
} else {
$('#sidebar-menu li ul').slideUp();
$(this).removeClass('vn');
$(this).addClass('nv');
$('ul', this).slideDown();
$('#sidebar-menu li').removeClass('active');
$(this).addClass('active');
}
});
$('#menu_toggle').click(function () {
if ($('body').hasClass('nav-md')) {
$('body').removeClass('nav-md');
$('body').addClass('nav-sm');
$('.left_col').removeClass('scroll-view');
$('.left_col').removeAttr('style');
$('.sidebar-footer').hide();
if ($('#sidebar-menu li').hasClass('active')) {
$('#sidebar-menu li.active').addClass('active-sm');
$('#sidebar-menu li.active').removeClass('active');
}
} else {
$('body').removeClass('nav-sm');
$('body').addClass('nav-md');
$('.sidebar-footer').show();
if ($('#sidebar-menu li').hasClass('active-sm')) {
$('#sidebar-menu li.active-sm').addClass('active');
$('#sidebar-menu li.active-sm').removeClass('active-sm');
}
}
});
});
/* Sidebar Menu active class */
$(function () {
var url = window.location;
$('#sidebar-menu a[href="' + url + '"]').parent('li').addClass('current-page');
$('#sidebar-menu a').filter(function () {
return this.href == url;
}).parent('li').addClass('current-page').parent('ul').slideDown().parent().addClass('active')
});
As I can always do by default to open URL it open minimized right and not expanded as it is currently working?
Pass the name of this template that I already see directly in the code and test. Meanwhile I will reply with the code that I think will work.
– André Monteiro