Skip to content

Instantly share code, notes, and snippets.

@farmerbradllc
Created October 6, 2011 00:28
Show Gist options
  • Save farmerbradllc/1266162 to your computer and use it in GitHub Desktop.
Save farmerbradllc/1266162 to your computer and use it in GitHub Desktop.
Navigation Portlet Default Markup
<div class="nav-menu nav-menu-style-dots" id="aui_3_4_0_1_1965">
<ul class="layouts level-1" id="aui_3_4_0_1_1964">
<li class="open "><a class="open " href="/web/navigation-portlet/home"> home</a></li>
<li class="open selected" id="aui_3_4_0_1_1963">
<a class="open selected" href="/web/navigation-portlet/page1" id="aui_3_4_0_1_1962"> Page1</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-a"> Link A</a></li>
<li class="open selected "><a class="open selected " href="/web/navigation-portlet/link-b"> Link B</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-c"> Link C</a></li>
</ul>
</li>
<li class="open ">
<a class="open " href="/web/navigation-portlet/page-2"> Page 2</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-d"> Link D</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-e"> Link E</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-f"> Link F</a></li>
</ul>
</li>
<li class="open ">
<a class="open " href="/web/navigation-portlet/page3"> Page3</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-g"> Link G</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-h"> Link H</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-i"> Link I</a></li>
</ul>
</li>
</ul>
</div>
<div class="nav-menu nav-menu-style-dots" id="aui_3_4_0_1_1965">
<ul class="layouts level-1" id="aui_3_4_0_1_1964">
<li class="open "><a class="open " href="/web/navigation-portlet/home"> home</a></li>
<li class="open " id="aui_3_4_0_1_1963">
<a class="open " href="/web/navigation-portlet/page1" id="aui_3_4_0_1_1962"> Page1</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-a"> Link A</a></li>
<li class="open selected "><a class="open selected " href="/web/navigation-portlet/link-b"> Link B</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-c"> Link C</a></li>
</ul>
</li>
<li class="open ">
<a class="open " href="/web/navigation-portlet/page-2"> Page 2</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-d"> Link D</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-e"> Link E</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-f"> Link F</a></li>
</ul>
</li>
<li class="open ">
<a class="open " href="/web/navigation-portlet/page3"> Page3</a>
<ul class="layouts level-2">
<li class="open "><a class="open " href="/web/navigation-portlet/link-g"> Link G</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-h"> Link H</a></li>
<li class="open "><a class="open " href="/web/navigation-portlet/link-i"> Link I</a></li>
</ul>
</li>
</ul>
</div>
AUI().ready(
'node',
function(A) {
var selectedChild = A.one('.nav-menu ul ul li.selected');
if(selectedChild){
var selectedParent = selectedChild.ancestor().ancestor();
if(selectedParent){
selectedParent.addClass('selected');
selectedParent.one('a').addClass('selected');
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment