1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

added keydown event for password prompt fields on job template launch

This commit is contained in:
Jared Tabor 2014-08-25 16:27:00 -04:00
parent 920011dd01
commit 8d21ff80d0

View File

@ -113,7 +113,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
function buildHtml() {
var fld, field, html;
html = "";
html += "<div class=\"alert alert-info\">Launching this job requires the passwords listed below. Enter and confirm each password before continuing.</div>\n";
html += "<div class=\"alert alert-info\" ng-keydown=\"keydown($event)\">Launching this job requires the passwords listed below. Enter and confirm each password before continuing.</div>\n";
html += "<form name=\"password_form\" novalidate>\n";
passwords.forEach(function(password) {
@ -125,6 +125,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
html += "<label for=\"" + fld + "\">* " + field.label + "</label>\n";
html += "<input type=\"password\" ";
html += "ng-model=\"" + fld + '" ';
html += "ng-keydown=\"keydown($event)\" ";
html += 'name="' + fld + '" ';
html += "class=\"password-field form-control input-sm\" ";
html += (field.associated) ? "ng-change=\"clearPWConfirm('" + field.associated + "')\" " : "";
@ -145,6 +146,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
html += "<label for=\"" + fld + "\">* " + field.label + "</label>\n";
html += "<input type=\"password\" ";
html += "ng-model=\"" + fld + '" ';
html += "ng-keydown=\"keydown($event)\" ";
html += 'name="' + fld + '" ';
html += "class=\"form-control input-sm\" ";
html += "ng-change=\"checkStatus()\" ";
@ -204,6 +206,11 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
$('#password-modal').dialog('open');
$('#password-accept-button').attr({ "disabled": "disabled" });
});
scope.keydown = function(e){
if(e.keyCode===13){
scope.passwordAccept();
}
};
scope.passwordAccept = function() {
if (!scope.password_form.$invalid) {