mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menubar: Handle ESCAPE to close and refactor document-click code to also use _bind
This commit is contained in:
parent
0872aac982
commit
2e38e04535
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user