]> source.dussan.org Git - jquery-ui.git/commitdiff
Menubar: Handle cursor UP/DOWN to open menu
authorjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 11:04:22 +0000 (12:04 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 11:04:22 +0000 (12:04 +0100)
tests/visual/menu/menubar.js

index 323f6f6816a6bdc3f06c996ad3603969f54750c7..bfd691bf02310006fe18001909fba33e3944d0fb 100644 (file)
@@ -62,6 +62,15 @@ $.widget("ui.menubar", {
                                        self._open(event, menu);
                                }
                        })
+                       .bind( "keydown", function( event ) {
+                               switch ( event.keyCode ) {
+                               case $.ui.keyCode.UP:
+                               case $.ui.keyCode.DOWN:
+                                       self._open( event, $( this ).next() );
+                                       event.preventDefault();
+                                       break;
+                               }
+                       })
                        .addClass("ui-button ui-widget ui-button-text-only ui-menubar-link")
                        .wrapInner("<span class='ui-button-text'></span>");