mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Fixed js error. For some reason form generator was unable to get the scope for js-tree after changes related to source_regions. Added a way to pass in scope.
This commit is contained in:
parent
376d59dfcc
commit
0af2980d10
@ -894,7 +894,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
}
|
||||
scope.removeChoicesComplete = scope.$on('choicesReady', function() {
|
||||
|
||||
generator.inject(form, { mode: 'edit', modal: false, related: false, id: 'tree-form', breadCrumbs: false });
|
||||
generator.inject(form, { mode: 'edit', modal: false, related: false, id: 'tree-form',
|
||||
breadCrumbs: false, scope: scope });
|
||||
generator.reset();
|
||||
|
||||
// Retrieve detail record and prepopulate the form
|
||||
|
||||
@ -68,9 +68,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
|
||||
else {
|
||||
element.html(this.build(options));
|
||||
}
|
||||
|
||||
if (options.scope) {
|
||||
this.scope = options.scope;
|
||||
}
|
||||
else {
|
||||
this.scope = element.scope();
|
||||
}
|
||||
|
||||
this.scope = element.scope(); // Set scope specific to the element we're compiling, avoids circular reference
|
||||
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||
$compile(element)(this.scope);
|
||||
|
||||
if (!options.buildTree && !options.html) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user