mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 09:51:09 +03:00
commit
07ef5a1f86
@ -738,7 +738,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
elem = document.getElementById('group-modal-dialog');
|
||||
$compile(elem)(modal_scope);
|
||||
|
||||
var form_scope =
|
||||
generator.inject(GroupForm, { mode: 'edit', id: 'properties-tab', breadCrumbs: false, related: false, scope: properties_scope });
|
||||
var source_form_scope =
|
||||
generator.inject(SourceForm, { mode: 'edit', id: 'sources-tab', breadCrumbs: false, related: false, scope: sources_scope });
|
||||
|
||||
//generator.reset();
|
||||
@ -881,6 +883,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
modal_scope.cancelModal();
|
||||
},
|
||||
open: function () {
|
||||
function updateButtonStatus(isValid) {
|
||||
$('.ui-dialog[aria-describedby="group-modal-dialog"]').find('.btn-primary').prop('disabled', !isValid);
|
||||
}
|
||||
form_scope.$watch('group_form.$valid', updateButtonStatus);
|
||||
source_form_scope.$watch('source_form.$valid', updateButtonStatus);
|
||||
$('#group_name').focus();
|
||||
Wait('stop');
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -201,15 +201,16 @@ export default
|
||||
|
||||
form.well = false;
|
||||
|
||||
generator.inject(form, {
|
||||
mode: 'edit',
|
||||
showButtons: false,
|
||||
showActions: false,
|
||||
id: 'inventory-edit-modal-dialog',
|
||||
breadCrumbs: false,
|
||||
related: false,
|
||||
scope: scope
|
||||
});
|
||||
var form_scope =
|
||||
generator.inject(form, {
|
||||
mode: 'edit',
|
||||
showButtons: false,
|
||||
showActions: false,
|
||||
id: 'inventory-edit-modal-dialog',
|
||||
breadCrumbs: false,
|
||||
related: false,
|
||||
scope: scope
|
||||
});
|
||||
|
||||
/* Reset form properties. Otherwise it screws up future requests of the Inventories detail page */
|
||||
form.well = true;
|
||||
@ -241,6 +242,7 @@ export default
|
||||
title: 'Inventory Properties',
|
||||
id: 'inventory-edit-modal-dialog',
|
||||
clonseOnEscape: false,
|
||||
form: form_scope.inventory_form,
|
||||
onClose: function() {
|
||||
Wait('stop');
|
||||
scope.codeMirror.destroy();
|
||||
|
@ -57,10 +57,15 @@ angular.module('ModalDialog', ['Utilities', 'ParseHelper'])
|
||||
beforeDestroy = params.beforeDestroy,
|
||||
closeOnEscape = (params.closeOnEscape === undefined) ? false : params.closeOnEscape,
|
||||
resizable = (params.resizable === undefined) ? true : params.resizable,
|
||||
forms = _.chain([params.form]).flatten().compact().value(),
|
||||
buttons,
|
||||
id = params.id,
|
||||
x, y, wh, ww;
|
||||
|
||||
function updateButtonStatus(isValid) {
|
||||
$('.ui-dialog[aria-describedby="' + id + '"]').find('.btn-primary').prop('disabled', !isValid);
|
||||
}
|
||||
|
||||
if (Empty(buttonSet)) {
|
||||
// Default button object
|
||||
buttonSet = [{
|
||||
@ -115,6 +120,12 @@ angular.module('ModalDialog', ['Utilities', 'ParseHelper'])
|
||||
});
|
||||
}, 300);
|
||||
|
||||
if (forms.length > 0) {
|
||||
forms.map(function(form_ctrl) {
|
||||
scope.$watch(form_ctrl.$name + '.$valid', updateButtonStatus);
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
scope.$apply(function() {
|
||||
scope.$emit(callback);
|
||||
@ -226,4 +237,4 @@ angular.module('ModalDialog', ['Utilities', 'ParseHelper'])
|
||||
ParseTypeChange({ scope: scope, field_id: textareaId, onReady: waitStop, variable: fld, onChange: onChange });
|
||||
}
|
||||
};
|
||||
}]);
|
||||
}]);
|
||||
|
Loading…
Reference in New Issue
Block a user