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"
|
at: "right top"
|
||||||
},
|
},
|
||||||
role: "menu",
|
role: "menu",
|
||||||
|
icon: "ui-icon-carat-1-e",
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
blur: null,
|
blur: null,
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
|
|
||||||
$( "#menu6" ).menu({
|
$( "#menu6" ).menu({
|
||||||
menus: ".menuElement",
|
menus: ".menuElement",
|
||||||
select: logger
|
select: logger,
|
||||||
|
icon: "ui-icon-carat-1-s"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -212,7 +213,7 @@
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</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="menuElement" id="menu6">
|
||||||
<div class="address-item">
|
<div class="address-item">
|
||||||
<a href="#">
|
<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"
|
at: "right top"
|
||||||
},
|
},
|
||||||
role: "menu",
|
role: "menu",
|
||||||
|
icon: "ui-icon-carat-1-e",
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
blur: null,
|
blur: null,
|
||||||
@ -279,6 +280,7 @@ $.widget( "ui.menu", {
|
|||||||
refresh: function() {
|
refresh: function() {
|
||||||
// Initialize nested menus
|
// Initialize nested menus
|
||||||
var menus,
|
var menus,
|
||||||
|
icon = this.options.icon,
|
||||||
submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
|
submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
|
||||||
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
|
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
|
||||||
.hide()
|
.hide()
|
||||||
@ -318,7 +320,7 @@ $.widget( "ui.menu", {
|
|||||||
var menu = $( this ),
|
var menu = $( this ),
|
||||||
item = menu.prev( "a" ),
|
item = menu.prev( "a" ),
|
||||||
submenuCarat = $( "<span>" )
|
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 );
|
.data( "ui-menu-submenu-carat", true );
|
||||||
|
|
||||||
item
|
item
|
||||||
|
Loading…
Reference in New Issue
Block a user