From db94db2957541d9bc9b2df2ced889fee6b337e8c Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Tue, 11 Mar 2014 18:16:15 +0200 Subject: [PATCH] Add support for ESC key in edit-in-place --- rd_ui/app/scripts/directives.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rd_ui/app/scripts/directives.js b/rd_ui/app/scripts/directives.js index edc387691..a41c9b863 100644 --- a/rd_ui/app/scripts/directives.js +++ b/rd_ui/app/scripts/directives.js @@ -270,6 +270,11 @@ // allow 'shift' to break lines if (e.which === 13 && !e.shiftKey) { save(); + } else if (e.which === 27) { + $scope.value = $scope.oldValue; + $scope.$apply(function() { + $(inputElement[0]).blur(); + }); } }).blur(function() { save();