]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Expose the submenu indicator icon as an icon option
authorkborchers <kris.borchers@gmail.com>
Tue, 10 Jul 2012 05:12:39 +0000 (00:12 -0500)
committerkborchers <kris.borchers@gmail.com>
Tue, 10 Jul 2012 05:14:54 +0000 (00:14 -0500)
tests/unit/menu/menu_common.js
tests/visual/menu/menu.html
ui/jquery.ui.menu.js

index 07295f1af03aebb5574720ac44d45211980a6033..02e0befe8a797fcc353d8e92acbd6a003a560d62 100644 (file)
@@ -7,6 +7,7 @@ TestHelpers.commonWidgetTests( "menu", {
                        at: "right top"
                },
                role: "menu",
+               icon: "ui-icon-carat-1-e",
 
                // callbacks
                blur: null,
index 5bda32eae9aa8fa6ab61e99ad5eae17845135658..205cb10c9afa774f0cf4968d19b8ed8758cb8d99 100644 (file)
@@ -26,7 +26,8 @@
 
                $( "#menu6" ).menu({
                        menus: ".menuElement",
-                       select: logger
+                       select: logger,
+                       icon: "ui-icon-carat-1-s"
                });
        });
        </script>
        </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="#">
index 7861230aa72184156a17e6877c47fc43dddc0b49..923421e529bd86b17fd9e39fb95336deecf07599 100644 (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