]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Close submenu on ESCAPE keypress
authorjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 16:43:11 +0000 (17:43 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 16:43:11 +0000 (17:43 +0100)
ui/jquery.ui.menu.js

index ad2fa3092894d7cf83decd359b2392a2b8a25739..af1101f73111a73faf3472bd7c35a4fe26efb452 100644 (file)
@@ -112,6 +112,12 @@ $.widget("ui.menu", {
                                event.preventDefault();
                                event.stopImmediatePropagation();
                                break;
+                       case $.ui.keyCode.ESCAPE:
+                               if ( self.left( event ) ) {
+                                       event.stopImmediatePropagation();
+                               }
+                               event.preventDefault();
+                               break;
                        default:
                                event.stopPropagation();
                                clearTimeout(self.filterTimer);