autofocus changes

This commit is contained in:
Gabriel Bazán 2015-09-29 15:48:55 -03:00
parent 552982d035
commit 4572b9a9c9
2 changed files with 11 additions and 8 deletions

View File

@ -16,7 +16,7 @@
<div class="input m20t">
<input type="password" placeholder="{{'Your password'|translate}}"
name="password" ng-model="pass.password" autofocus>
id="passwordInput" name="password" ng-model="pass.password">
</div>
</div>
<div class="row">

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('passwordController',
function($rootScope, $scope, $timeout, profileService, notification, go, gettext) {
function($rootScope, $scope, $timeout, profileService, notification, go, gettext) {
var self = this;
@ -9,18 +9,21 @@ angular.module('copayApp.controllers').controller('passwordController',
self.isVerification = false;
self.close = function(cb){
document.getElementById("passwordInput").focus();
self.close = function(cb) {
return cb('No password given');
};
self.set = function(isSetup, cb){
self.set = function(isSetup, cb) {
self.error = false;
if (isSetup && !self.isVerification) {
document.getElementById("passwordInput").focus();
self.isVerification = true;
pass1= self.password;
pass1 = self.password;
self.password = null;
$timeout(function(){
$timeout(function() {
$rootScope.$apply();
})
return;
@ -30,7 +33,7 @@ angular.module('copayApp.controllers').controller('passwordController',
self.error = gettext('Passwords do not match');
self.isVerification = false;
self.password = null;
pass1 =null;
pass1 = null;
return;
}
@ -38,4 +41,4 @@ angular.module('copayApp.controllers').controller('passwordController',
return cb(null, self.password);
};
});
});