disable button and input field during decryption

This commit is contained in:
Bjoern Schiessle 2014-01-24 12:05:14 +01:00
parent 2a3cb7ac5b
commit 6bb27ea76b
1 changed files with 5 additions and 0 deletions

View File

@ -206,6 +206,8 @@ $(document).ready(function(){
$('button:button[name="submitDecryptAll"]').click(function() {
var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val();
$('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
$('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
OC.Encryption.decryptAll(privateKeyPassword);
});
@ -214,6 +216,8 @@ $(document).ready(function(){
if (privateKeyPassword !== '' ) {
$('#decryptAll button:button[name="submitDecryptAll"]').removeAttr("disabled");
if(event.which === 13) {
$('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
$('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
OC.Encryption.decryptAll(privateKeyPassword);
}
} else {
@ -280,6 +284,7 @@ OC.Encryption = {
$.post('ajax/decryptall.php', {password:password}, function(data) {
if (data.status === "error") {
OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data);
$('#decryptAll input:password[name="privateKeyPassword"]').removeAttr("disabled");
} else {
OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data);
}