Skip to content
Permalink
Browse files

Menubar: Handle ESCAPE to close and refactor document-click code to a…

…lso use _bind
  • Loading branch information
jzaefferer committed Mar 17, 2011
1 parent 0872aac commit 2e38e0453510e198f66202c0f3e887296e5b06cc
Showing with 11 additions and 2 deletions.
  1. +11 −2 tests/visual/menu/menubar.js
@@ -75,8 +75,17 @@ $.widget("ui.menubar", {
};

});
$(document).click(function(event) {
!$(event.target).closest(".ui-menubar").length && self._close();
self._bind(document, {
click: function(event) {
!$(event.target).closest(".ui-menubar").length && self._close();
}
})
self._bind({
keyup: function(event) {
if (event.keyCode == $.ui.keyCode.ESCAPE) {
self._close();
}
}
});
},

0 comments on commit 2e38e04

Please sign in to comment.
You can’t perform that action at this time.