enter key on the keyboard submit the spending password popup

This commit is contained in:
Gabriel Bazán 2016-06-21 16:47:53 -03:00 committed by Gustavo Maximiliano Cortez
commit 61f6909d9a
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 6 additions and 1 deletions

View file

@ -10,7 +10,7 @@
<div class="input m20t">
<input type="password" placeholder="{{'Your spending password'|translate}}"
id="passwordInput" name="password" ng-model="data.password" autofocus>
id="passwordInput" name="password" ng-model="data.password" ng-keypress="keyPress($event)" autofocus>
</div>
</div>
<div class="row">

View file

@ -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;