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"> <div class="input m20t">
<input type="password" placeholder="{{'Your password'|translate}}" <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> </div>
<div class="row"> <div class="row">

View File

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