mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
Add ESC handle for popover and dropdown (#1119)
* Add ESC handle for popover and dropdown
This commit is contained in:
@@ -30,6 +30,19 @@ define([
|
||||
return true;
|
||||
});
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
// ESCAPE key pressed
|
||||
if (e.keyCode == 27) {
|
||||
var view = app.ui.currentDropdown;
|
||||
if (view) {
|
||||
view.hide();
|
||||
if (app.ui.currentHighlightedItem) {
|
||||
app.ui.currentHighlightedItem.rmHighlight();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var DropdownView = Backbone.View.extend({
|
||||
|
||||
defaultOptions: {
|
||||
|
Reference in New Issue
Block a user