From 61f6909d9a7c0533a6d9077df3a28f1d56d0f988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 21 Jun 2016 16:47:53 -0300 Subject: [PATCH] enter key on the keyboard submit the spending password popup --- public/views/includes/password.html | 2 +- src/js/controllers/index.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/views/includes/password.html b/public/views/includes/password.html index 7dbf4ef39..4a16c11bc 100644 --- a/public/views/includes/password.html +++ b/public/views/includes/password.html @@ -10,7 +10,7 @@
+ id="passwordInput" name="password" ng-model="data.password" ng-keypress="keyPress($event)" autofocus>
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 1afccdd38..977cba5de 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -1727,6 +1727,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r return cb('No spending password given'); }; + $scope.keyPress = function(event) { + if (!$scope.data.password || $scope.loading) return; + if (event.keyCode == 13) $scope.set(); + } + $scope.set = function() { $scope.loading = true; $scope.error = null;