mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu: Expose the submenu indicator icon as an icon option
This commit is contained in:
parent
1a22a675d8
commit
db3fabedb4
@ -7,6 +7,7 @@ TestHelpers.commonWidgetTests( "menu", {
|
||||
at: "right top"
|
||||
},
|
||||
role: "menu",
|
||||
icon: "ui-icon-carat-1-e",
|
||||
|
||||
// callbacks
|
||||
blur: null,
|
||||
|
@ -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="#">
|
||||
|
4
ui/jquery.ui.menu.js
vendored
4
ui/jquery.ui.menu.js
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user