NIHVIVO-2280: On main account page, If there is no account selected for deletion and the user click on the DELETE button, the page was throwing a js alert displaying, "Are you sure you want to delete this account?". I have fixed this error.

This commit is contained in:
manolobevia 2011-06-09 21:53:15 +00:00
parent 8f995412dd
commit 371997da6f

View file

@ -10,7 +10,6 @@ $(document).ready(function(){
$('#account-display').submit();
});
//Delete accounts
//Show is javascript is enable
$('input:checkbox[name=delete-all]').show();
@ -24,17 +23,20 @@ $(document).ready(function(){
// if not checked, deselect all the checkboxes
$('input:checkbox[name=deleteAccount]').removeAttr('checked');
}
});
$('input:checkbox[name=deleteAccount]').click(function(){
$('input:checkbox[name=delete-all]').removeAttr('checked');
});
$('input:checkbox[name=deleteAccount]').click(function(){
$('input:checkbox[name=delete-all]').removeAttr('checked');
});
// Confirmation alert for account deletion in userAccounts-list.ftl template
$('input[name="delete-account"]').click(function(){
var countAccount = $('input:checkbox[name=deleteAccount]:checked').length;
var answer = confirm( 'Are you sure you want to delete ' + ((countAccount > 1) ? 'these accounts' : 'this account') +'?');
return answer;
});
// Confirmation alert for account deletion in userAccounts-list.ftl template
$('input[name="delete-account"]').click(function(){
var countAccount = $('input:checkbox[name=deleteAccount]:checked').length;
if (countAccount == 0){
return false;
}else{
var answer = confirm( 'Are you sure you want to delete ' + ((countAccount > 1) ? 'these accounts' : 'this account') +'?');
return answer;
}
});
});