1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-23 01:12:19 -05:00

disable unlock button on passphrase commit

This commit is contained in:
Tankred Hase 2013-10-22 14:37:32 +02:00
parent d15af5b394
commit 1d44993d8b
2 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,8 @@ define(function(require) {
var appController = require('js/app-controller');
var LoginExistingCtrl = function($scope, $location) {
$scope.buttonEnabled = true;
$scope.confirmPassphrase = function() {
var passphrase = $scope.passphrase,
emailDao = appController._emailDao;
@ -13,6 +14,8 @@ define(function(require) {
return;
}
// disable button once loggin has started
$scope.buttonEnabled = false;
unlockCrypto(imapLogin);
function unlockCrypto(callback) {
@ -28,6 +31,7 @@ define(function(require) {
function imapLogin(err) {
if (err) {
$scope.buttonEnabled = true;
console.error(err);
return;
}
@ -35,6 +39,7 @@ define(function(require) {
// login to imap backend
appController._emailDao.imapLogin(function(err) {
if (err) {
$scope.buttonEnabled = true;
console.error(err);
return;
}
@ -50,4 +55,4 @@ define(function(require) {
};
return LoginExistingCtrl;
});
});

View File

@ -14,7 +14,7 @@
<input type="password" ng-model="passphrase" class="passphrase" placeholder="Passphrase" tabindex="1" focus-me="true">
</div>
<div>
<button type="submit" ng-click="confirmPassphrase()" class="btn" tabindex="2">Unlock</button>
<button type="submit" ng-click="confirmPassphrase()" class="btn" ng-disabled="!buttonEnabled" tabindex="2">Unlock</button>
</div>
</form>
</div><!--/content-->