Modal dialogs should capture all keystrokes but not interfere with other onKeydowns
This commit is contained in:
parent
ad05ca1515
commit
303fc584c9
1 changed files with 25 additions and 0 deletions
|
|
@ -365,6 +365,30 @@ let splithandler_plugin = (function () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// onKeydown check for 'ESC' key.
|
||||||
|
var onKeydown = function (event) {
|
||||||
|
var code = event.which;
|
||||||
|
|
||||||
|
if (code === 27) { // Escape key
|
||||||
|
if ($('#splitdialogcontent').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#splitdialogcontent");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ($('#panedialogcontent').is(':visible')) {
|
||||||
|
plugins['popups'].closePopup("#panedialogcontent");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// capture all keys while one of our "modal" dialogs is open
|
||||||
|
if ($('#splitdialogcontent').is(':visible') || $('#panedialogcontent').is(':visible')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Required plugin "init" function
|
// Required plugin "init" function
|
||||||
var init = function(settings) {
|
var init = function(settings) {
|
||||||
|
|
@ -408,6 +432,7 @@ let splithandler_plugin = (function () {
|
||||||
dynamic_split: dynamic_split,
|
dynamic_split: dynamic_split,
|
||||||
undo_split: undo_split,
|
undo_split: undo_split,
|
||||||
set_pane_types: set_pane_types,
|
set_pane_types: set_pane_types,
|
||||||
|
onKeydown: onKeydown,
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
plugin_handler.add('splithandler', splithandler_plugin);
|
plugin_handler.add('splithandler', splithandler_plugin);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue