digicorp / propeller

Propeller - Develop more, Code less. Propeller is a front-end responsive framework based on Google's Material Design Standards & Bootstrap.
http://propeller.in
MIT License
1.13k stars 141 forks source link

Sidebar item .active #20

Closed mika76 closed 7 years ago

mika76 commented 7 years ago

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

sunil-digicorp commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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