mirror of
https://github.com/moparisthebest/mail
synced 2024-11-26 19:02:20 -05:00
disable unlock button on passphrase commit
This commit is contained in:
parent
d15af5b394
commit
1d44993d8b
@ -4,7 +4,8 @@ define(function(require) {
|
|||||||
var appController = require('js/app-controller');
|
var appController = require('js/app-controller');
|
||||||
|
|
||||||
var LoginExistingCtrl = function($scope, $location) {
|
var LoginExistingCtrl = function($scope, $location) {
|
||||||
|
$scope.buttonEnabled = true;
|
||||||
|
|
||||||
$scope.confirmPassphrase = function() {
|
$scope.confirmPassphrase = function() {
|
||||||
var passphrase = $scope.passphrase,
|
var passphrase = $scope.passphrase,
|
||||||
emailDao = appController._emailDao;
|
emailDao = appController._emailDao;
|
||||||
@ -13,6 +14,8 @@ define(function(require) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable button once loggin has started
|
||||||
|
$scope.buttonEnabled = false;
|
||||||
unlockCrypto(imapLogin);
|
unlockCrypto(imapLogin);
|
||||||
|
|
||||||
function unlockCrypto(callback) {
|
function unlockCrypto(callback) {
|
||||||
@ -28,6 +31,7 @@ define(function(require) {
|
|||||||
|
|
||||||
function imapLogin(err) {
|
function imapLogin(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
$scope.buttonEnabled = true;
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -35,6 +39,7 @@ define(function(require) {
|
|||||||
// login to imap backend
|
// login to imap backend
|
||||||
appController._emailDao.imapLogin(function(err) {
|
appController._emailDao.imapLogin(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
$scope.buttonEnabled = true;
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -50,4 +55,4 @@ define(function(require) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return LoginExistingCtrl;
|
return LoginExistingCtrl;
|
||||||
});
|
});
|
@ -14,7 +14,7 @@
|
|||||||
<input type="password" ng-model="passphrase" class="passphrase" placeholder="Passphrase" tabindex="1" focus-me="true">
|
<input type="password" ng-model="passphrase" class="passphrase" placeholder="Passphrase" tabindex="1" focus-me="true">
|
||||||
</div>
|
</div>
|
||||||
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div><!--/content-->
|
</div><!--/content-->
|
||||||
|
Loading…
Reference in New Issue
Block a user