Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar item .active #20

Closed
mika76 opened this issue Apr 18, 2017 · 3 comments
Closed

Sidebar item .active #20

mika76 opened this issue Apr 18, 2017 · 3 comments

Comments

@mika76
Copy link

mika76 commented Apr 18, 2017

There does not seem to be an active class that working in the sidebar menu?

@sunil-digicorp
Copy link
Member

Hello,

We have managed .active class code in our admin theme. Please refer to the below link:
http://propeller.in/templates/admin-dashboard/index.html

Else you can also include below code snippet in your template to add .active class:

$(document).ready(function() {
  var sPath=window.location.pathname;
  var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
  $(".pmd-sidebar-nav").each(function(){
  $(this).find("a[href='"+sPage+"']").parents(".dropdown").addClass("open");
  $(this).find("a[href='"+sPage+"']").parents(".dropdown").find('.dropdown-menu').css("display", "block");
  $(this).find("a[href='"+sPage+"']").parents(".dropdown").find('a.dropdown-toggle').addClass("active");
  $(this).find("a[href='"+sPage+"']").addClass("active");
  });
});

Please let us know if this solution worked for you.

@mika76
Copy link
Author

mika76 commented Apr 20, 2017

Hi @sunil-digicorp

I was trying to say that the class .active does not exist in the default template. This means I would have to add the admin template to my project which I don't want to do.

I think you should add it to the standard template, since you have sidebar there and it's weird not to have an active state for a menu.

@sunil-digicorp
Copy link
Member

Hello,
Your point is noted. We will include in out next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants