Menu: Close submenu on ESCAPE keypress

This commit is contained in:
jzaefferer 2011-03-17 17:43:11 +01:00
parent c0f7afd160
commit 5a112d4e03

View File

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