Last active
August 30, 2021 08:53
-
-
Save emmanueltissera/16edd43bddb214e6da5555bda3464d4f to your computer and use it in GitHub Desktop.
Caching Dynamic Menus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="hidden"> | |
<li class="dropdown loginStatusReplace"> | |
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Test User<i class="fa fa-chevron-down " title=""></i></a> | |
<ul class="dropdown-menu" role="menu"> | |
<li><a href="/account">My Account</a></li> | |
<li class="divider"></li> | |
<li><a href="/logout">Sign out</a></li> | |
</ul> | |
</li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
var replacement = $(".loginStatusReplace"); | |
if (!replacement.length) { | |
return; | |
} | |
$(".loginStatus").replaceWith(replacement); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$(".breadcrumb li").each(function() { | |
var menuId = $(this).attr("data-id"); | |
var menuElementSelector = '.nav.navbar-nav li[data-id="' + menuId + '"]'; | |
$(menuElementSelector).addClass("selected active"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment