1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

Add ESC handle for popover and dropdown (#1119)

* Add ESC handle for popover and dropdown
This commit is contained in:
Daniel Pan
2016-04-13 20:16:29 +08:00
parent 0320d2e4b2
commit 9cea2733ca
2 changed files with 23 additions and 0 deletions

View File

@@ -27,6 +27,16 @@ define([
return true;
});
$(document).keydown(function(e) {
// ESCAPE key pressed
if (e.keyCode == 27) {
var view = app.ui.currentPopover;
if (view) {
view.hide();
}
}
});
$(window).resize(function() {
var view = app.ui.currentPopover;
if (!view) {