Skip to content

Commit

Permalink
enhanced sidebar-menu by addClass active
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaric committed Oct 13, 2015
1 parent 62dba20 commit 80aa074
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/webapp/WEB-INF/views/common/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@

${headContent}

</head>
<script>
$(document).ready(function () {
var pgurl = window.location.href;
console.log(pgurl);
// active:ul.sidebar-menu -> li -> a
$("ul.sidebar-menu>li>a").each(function () {
if ($(this).attr("href") != '#' && pgurl.indexOf($(this).attr("href").split("?")[0]) >= 0) {
$(this).parent().addClass("active");
}
});
});
</script>

</head>

0 comments on commit 80aa074

Please sign in to comment.