nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marka...@apache.org
Subject [14/28] incubator-nifi git commit: NIFI-346: - Fixing issue when attempting to close dialogs via Esc keystroke. Was exiting method early with dialogs open to prevent other shortcuts.
Date Sun, 22 Feb 2015 16:19:10 GMT
NIFI-346:
- Fixing issue when attempting to close dialogs via Esc keystroke. Was exiting method early
with dialogs open to prevent other shortcuts.

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/a416dfdb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/a416dfdb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/a416dfdb

Branch: refs/heads/nifi-site-to-site-client
Commit: a416dfdb0f453861c71aa66be70b0f01e8aee5a5
Parents: 05c0195
Author: Matt Gilman <matt.c.gilman@gmail.com>
Authored: Thu Feb 12 10:19:56 2015 -0500
Committer: Matt Gilman <matt.c.gilman@gmail.com>
Committed: Thu Feb 12 10:19:56 2015 -0500

----------------------------------------------------------------------
 .../src/main/webapp/js/nf/canvas/nf-canvas.js    | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/a416dfdb/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index 26db837..f11ec30 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -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();
@@ -544,11 +556,6 @@ nf.Canvas = (function () {
                     nf.Actions['delete'](nf.CanvasUtils.getSelection());
 
                     evt.preventDefault();
-                } else if (evt.keyCode === 27) {
-                    // esc
-                    nf.Actions.hideDialogs();
-
-                    evt.preventDefault();
                 }
             }
         });


Mime
View raw message