Skip to content
Permalink
Browse files

Menu: Added better nesting support for nested menu items

  • Loading branch information...
Paul Jackson Paul Jackson
Paul Jackson authored and Paul Jackson committed Jan 28, 2015
1 parent 5c71fd1 commit ed5b1987488b75621ba8729cc30ca34ced2d52d1
Showing with 18 additions and 4 deletions.
  1. +0 −1 src/plugins/menu/_base.scss
  2. +5 −3 src/plugins/menu/menu.js
  3. +13 −0 theme/secondary-menu/_base.scss
@@ -184,7 +184,6 @@
}

summary {
margin-left: -3px;
padding-left: 3px;

&.wb-navcurr {
@@ -112,7 +112,7 @@ var componentName = "wb-menu",
createCollapsibleSection = function( section, sectionIndex, sectionsLength, $items, itemsLength ) {

// Use details/summary for the collapsible mechanism
var k, $elm, elm, $item, $subItems,
var k, $elm, elm, $item, $subItems, subItemsLength,
$section = $( section ),
posinset = "' aria-posinset='",
menuitem = "role='menuitem' aria-setsize='",
@@ -127,15 +127,17 @@ var componentName = "wb-menu",
$item = $items.eq( k );
$elm = $item.find( menuItemSelector );
elm = $elm[ 0 ];
if ( elm.nodeName.toLowerCase() === "a" ) {
$subItems = $elm.parent().find( "> ul > li" );
subItemsLength = $subItems.length;

if ( subItemsLength === 0 && elm.nodeName.toLowerCase() === "a" ) {
sectionHtml += "<li>" + $item[ 0 ].innerHTML.replace(
/(<a\s)/,
"$1 " + menuitem + itemsLength +
posinset + ( k + 1 ) +
"' tabindex='-1' "
) + "</li>";
} else {
$subItems = $elm.parent().find( "> ul > li" );
sectionHtml += createCollapsibleSection( elm, k, itemsLength, $subItems, $subItems.length );
}
}
@@ -56,3 +56,16 @@
}
}
}

[dir=rtl] {
#wb-sec {
.list-group {
.list-group {
.list-group-item {
padding-left: 15px;
padding-right: 1.8em;
}
}
}
}
}

0 comments on commit ed5b198

Please sign in to comment.
You can’t perform that action at this time.