mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
set focus on first input in modal when launching jt
This commit is contained in:
parent
e943ae59b7
commit
e5f48bfa62
@ -216,6 +216,7 @@ export default [ 'ProcessErrors', 'CredentialTypeModel', 'TemplatesStrings', '$f
|
||||
} else if(vm.steps[step].tab.order === currentTab.order + 1) {
|
||||
vm.steps[step].tab._active = true;
|
||||
vm.steps[step].tab._disabled = false;
|
||||
scope.$broadcast('promptTabChange', { step });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="Prompt-step">
|
||||
<div ng-if="vm.steps.inventory.includeStep" ng-show="vm.steps.inventory.tab._active" id="prompt_inventory_step">
|
||||
<prompt-inventory
|
||||
prompt-data="vm.promptDataClone"
|
||||
read-only-prompts="vm.readOnlyPrompts">
|
||||
</prompt-inventory>
|
||||
prompt-data="vm.promptDataClone"
|
||||
read-only-prompts="vm.readOnlyPrompts">
|
||||
</prompt-inventory>
|
||||
</div>
|
||||
<div ng-if="vm.steps.credential.includeStep" ng-show="vm.steps.credential.tab._active" id="prompt_credential_step">
|
||||
<prompt-credential
|
||||
|
||||
@ -103,16 +103,26 @@ export default
|
||||
}
|
||||
scope.validate = validate;
|
||||
|
||||
angular.element(el).ready(() => {
|
||||
const inputs = el.find('input, select');
|
||||
function focusFirstInput () {
|
||||
const inputs = el.find('input[type=text], select, textarea:visible, .CodeMirror textarea');
|
||||
if (inputs.length) {
|
||||
inputs.get(0).focus();
|
||||
}
|
||||
}
|
||||
|
||||
angular.element(el).ready(() => {
|
||||
focusFirstInput();
|
||||
});
|
||||
|
||||
scope.$on('promptTabChange', (event, args) => {
|
||||
if (args.step === 'other_prompts') {
|
||||
angular.element(el).ready(() => {
|
||||
focusFirstInput();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
vm.toggleDiff = () => {
|
||||
scope.promptData.prompts.diffMode.value = !scope.promptData.prompts.diffMode.value;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user