admin: on pki page, press enter to associate certificate
This commit is contained in:
parent
3f692984c7
commit
d093f3670b
2 changed files with 41 additions and 10 deletions
|
@ -659,6 +659,23 @@ angular.module("FICApp")
|
|||
}
|
||||
};
|
||||
|
||||
$scope.validateSearch = function(keyEvent) {
|
||||
if (keyEvent.which === 13) {
|
||||
var myCertificate = null;
|
||||
$scope.certificates.forEach(function(certificate) {
|
||||
if (String(certificate.id).indexOf($scope.query.toUpperCase()) >= 0) {
|
||||
if (myCertificate === null)
|
||||
myCertificate = certificate;
|
||||
else
|
||||
myCertificate = false;
|
||||
}
|
||||
});
|
||||
if (myCertificate && myCertificate.id_team == null) {
|
||||
$('#associationModal').data('certificate', myCertificate.id)
|
||||
$('#associationModal').modal()
|
||||
}
|
||||
}
|
||||
};
|
||||
$scope.validatePKIForm = function(keyEvent) {
|
||||
if (keyEvent.which === 13)
|
||||
$scope.associate()
|
||||
|
|
Reference in a new issue