mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -02:30
adding changes to form generator for ngDisabled for buttons
This commit is contained in:
@@ -1253,7 +1253,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
|
|||||||
// string to be injected into the current view.
|
// string to be injected into the current view.
|
||||||
//
|
//
|
||||||
var btn, button, fld, field, html = '', i, section, group,
|
var btn, button, fld, field, html = '', i, section, group,
|
||||||
tab, sectionShow, offset, width;
|
tab, sectionShow, offset, width,ngDisabled;
|
||||||
|
|
||||||
if (!this.modal && (options.breadCrumbs === undefined || options.breadCrumbs === true)) {
|
if (!this.modal && (options.breadCrumbs === undefined || options.breadCrumbs === true)) {
|
||||||
if (this.form.navigationLinks) {
|
if (this.form.navigationLinks) {
|
||||||
@@ -1446,9 +1446,10 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
|
|||||||
html += this.attr(button, 'ngClick');
|
html += this.attr(button, 'ngClick');
|
||||||
}
|
}
|
||||||
if (button.ngDisabled) {
|
if (button.ngDisabled) {
|
||||||
|
ngDisabled = (button.ngDisabled===true) ? this.form.name+"_form.$invalid" : button.ngDisabled;
|
||||||
if (btn !== 'reset') {
|
if (btn !== 'reset') {
|
||||||
//html += "ng-disabled=\"" + this.form.name + "_form.$pristine || " + this.form.name + "_form.$invalid";
|
//html += "ng-disabled=\"" + this.form.name + "_form.$pristine || " + this.form.name + "_form.$invalid";
|
||||||
html += "ng-disabled=\"" + this.form.name + "_form.$invalid";
|
html += "ng-disabled=\"" + ngDisabled;
|
||||||
//html += (this.form.allowReadonly) ? " || " + this.form.name + "ReadOnly == true" : "";
|
//html += (this.form.allowReadonly) ? " || " + this.form.name + "ReadOnly == true" : "";
|
||||||
html += "\" ";
|
html += "\" ";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user