From c24a822fc51b7bbb8056238509e1cfbb31fee523 Mon Sep 17 00:00:00 2001 From: juanmont Date: Fri, 13 Jan 2017 15:10:21 +0100 Subject: [PATCH] Added posibility to press ESC in the noVNC Dialog (#181) --- src/sunstone/public/app/utils/dialogs/dialog.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/app/utils/dialogs/dialog.js b/src/sunstone/public/app/utils/dialogs/dialog.js index f564b1dada..eb2512e40a 100644 --- a/src/sunstone/public/app/utils/dialogs/dialog.js +++ b/src/sunstone/public/app/utils/dialogs/dialog.js @@ -53,6 +53,14 @@ define(function(require) { that.show(); }); + dialogElement.on('keydown', function(evt) { + if (evt.keyCode == 27 && dialogElement[0].id == "vncVMDialog") { + evt.keyCode = 0; + evt.key = ""; + evt.which = 0; + } + }); + that.dialogElement = dialogElement; return that.dialogElement; @@ -64,7 +72,7 @@ define(function(require) { } function _hide() { - this.dialogElement.foundation('close'); + this.dialogElement.foundation('close'); } function _reset() {