Menu: Expose the submenu indicator icon as an icon option

This commit is contained in:
kborchers 2012-07-10 00:12:39 -05:00
parent 1a22a675d8
commit db3fabedb4
3 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,7 @@ TestHelpers.commonWidgetTests( "menu", {
at: "right top"
},
role: "menu",
icon: "ui-icon-carat-1-e",
// callbacks
blur: null,

View File

@ -26,7 +26,8 @@
$( "#menu6" ).menu({
menus: ".menuElement",
select: logger
select: logger,
icon: "ui-icon-carat-1-s"
});
});
</script>
@ -212,7 +213,7 @@
</blockquote>
</div>
<h2>Menu with custom markup, multi-line items</h2>
<h2>Menu with custom markup, multi-line items and a custom submenu icon</h2>
<div class="menuElement" id="menu6">
<div class="address-item">
<a href="#">

View File

@ -28,6 +28,7 @@ $.widget( "ui.menu", {
at: "right top"
},
role: "menu",
icon: "ui-icon-carat-1-e",
// callbacks
blur: null,
@ -279,6 +280,7 @@ $.widget( "ui.menu", {
refresh: function() {
// Initialize nested menus
var menus,
icon = this.options.icon,
submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.hide()
@ -318,7 +320,7 @@ $.widget( "ui.menu", {
var menu = $( this ),
item = menu.prev( "a" ),
submenuCarat = $( "<span>" )
.addClass( "ui-menu-icon ui-icon ui-icon-carat-1-e" )
.addClass( "ui-menu-icon ui-icon " + icon )
.data( "ui-menu-submenu-carat", true );
item