mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 22:48:02 -03:30
Prevent clicks outside of prompt modal from closing the modal without saving. User will now need to explicity hit the X or Cancel buttons to close the modal prematurely.
This commit is contained in:
parent
6499f2b233
commit
47c59d5211
@ -33,18 +33,23 @@ function AtModalController ($timeout, eventService, strings) {
|
||||
vm.modal.title = title;
|
||||
vm.modal.message = message;
|
||||
|
||||
listeners = eventService.addListeners([
|
||||
[overlay, 'click', vm.clickToHide]
|
||||
]);
|
||||
if (!vm.modal.preventOutsideClick) {
|
||||
listeners = eventService.addListeners([
|
||||
[overlay, 'click', vm.clickToHide]
|
||||
]);
|
||||
}
|
||||
|
||||
overlay.style.display = 'block';
|
||||
overlay.style.opacity = 1;
|
||||
};
|
||||
|
||||
vm.hide = () => {
|
||||
console.log('hide');
|
||||
overlay.style.opacity = 0;
|
||||
|
||||
eventService.remove(listeners);
|
||||
if (!vm.modal.preventOutsideClick) {
|
||||
eventService.remove(listeners);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
overlay.style.display = 'none';
|
||||
|
||||
@ -13,6 +13,8 @@ export default [ 'ProcessErrors', 'CredentialTypeModel', 'TemplatesStrings', '$f
|
||||
scope = _scope_;
|
||||
({ modal } = scope[scope.ns]);
|
||||
|
||||
modal.preventOutsideClick = true;
|
||||
|
||||
scope.$watch('vm.promptData.triggerModalOpen', () => {
|
||||
vm.actionButtonClicked = false;
|
||||
if(vm.promptData && vm.promptData.triggerModalOpen) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user