mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
auto-focus first input in jt launch modal
This commit is contained in:
parent
7b16931658
commit
e943ae59b7
@ -12,7 +12,7 @@ export default
|
||||
|
||||
let scope;
|
||||
|
||||
vm.init = (_scope_) => {
|
||||
vm.init = (_scope_, controller, el) => {
|
||||
scope = _scope_;
|
||||
|
||||
scope.parseType = 'yaml';
|
||||
@ -102,6 +102,13 @@ export default
|
||||
return ToJSON(scope.parseType, scope.extraVariables, true);
|
||||
}
|
||||
scope.validate = validate;
|
||||
|
||||
angular.element(el).ready(() => {
|
||||
const inputs = el.find('input, select');
|
||||
if (inputs.length) {
|
||||
inputs.get(0).focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ export default [ 'templateUrl',
|
||||
const launchController = controllers[0];
|
||||
const promptOtherPromptsController = controllers[1];
|
||||
|
||||
promptOtherPromptsController.init(scope, launchController);
|
||||
promptOtherPromptsController.init(scope, launchController, el);
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user