From 4fe017d2ec91565b5f4d286d37cdb62441b480a9 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 7 Apr 2017 12:39:13 -0400 Subject: [PATCH] Fix survey button ids (#5975) Change all references to 'btn' within the relatedButton loop to the loop variable 'itm' so that survey button ids are no longer shown as 'job_template_undefined_btn'. --- awx/ui/client/src/shared/form-generator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 70e515f3a5..28e4619146 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1520,7 +1520,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "class=\"btn btn-sm"; html += (button['class']) ? " " + button['class'] : ""; html += "\" "; - html += "id=\"" + this.form.name + "_" + btn + "_btn\" "; + html += "id=\"" + this.form.name + "_" + itm + "_btn\" "; if(button.ngShow){ html += this.attr(button, 'ngShow'); @@ -1533,7 +1533,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat } if (button.ngDisabled) { ngDisabled = (button.ngDisabled===true) ? this.form.name+"_form.$invalid" : button.ngDisabled; - if (btn !== 'reset') { + if (itm !== 'reset') { //html += "ng-disabled=\"" + this.form.name + "_form.$pristine || " + this.form.name + "_form.$invalid"; html += "ng-disabled=\"" + ngDisabled; //html += (this.form.allowReadonly) ? " || " + this.form.name + "ReadOnly == true" : ""; @@ -1572,7 +1572,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "class=\"btn btn-sm Form-tab--disabled"; html += (button['class']) ? " " + button['class'] : ""; html += "\" "; - html += "id=\"" + this.form.name + "_" + btn + "_btn\" "; + html += "id=\"" + this.form.name + "_" + itm + "_btn\" "; if(button.ngShow){ html += this.attr(button, 'ngShow');