admin: on pki page, press enter to associate certificate

This commit is contained in:
nemunaire 2020-01-28 16:20:01 +01:00
parent 3f692984c7
commit d093f3670b
2 changed files with 41 additions and 10 deletions

View file

@ -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()