mirror of https://github.com/apache/nifi.git
NIFI-346:
- Fixing issue when attempting to close dialogs via Esc keystroke. Was exiting method early with dialogs open to prevent other shortcuts.
This commit is contained in:
parent
05c01952ad
commit
a416dfdb0f
|
@ -510,12 +510,24 @@ nf.Canvas = (function () {
|
|||
$(window).on('resize', function () {
|
||||
updateGraphSize();
|
||||
}).on('keydown', function (evt) {
|
||||
var isCtrl = evt.ctrlKey || evt.metaKey;
|
||||
|
||||
// consider escape, before checking dialogs
|
||||
if (!isCtrl && evt.keyCode === 27) {
|
||||
// esc
|
||||
nf.Actions.hideDialogs();
|
||||
|
||||
evt.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// if a dialog is open, disable canvas shortcuts
|
||||
if ($('.dialog').is(':visible')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (evt.ctrlKey || evt.metaKey) {
|
||||
// handle shortcuts
|
||||
if (isCtrl) {
|
||||
if (evt.keyCode === 82) {
|
||||
// ctrl-r
|
||||
nf.Actions.reloadStatus();
|
||||
|
@ -543,11 +555,6 @@ nf.Canvas = (function () {
|
|||
// delete
|
||||
nf.Actions['delete'](nf.CanvasUtils.getSelection());
|
||||
|
||||
evt.preventDefault();
|
||||
} else if (evt.keyCode === 27) {
|
||||
// esc
|
||||
nf.Actions.hideDialogs();
|
||||
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue