[FIX] website_event: improve registration modal behavior

Currently there are 3 ways of going out of the modal: clicking cancel
registration, hitting the close button or clicking outside the modal.
The latter one however does not trigger the close event for modals and
therefore buttons of event registration are not reset correctly. This
commit fixes that behavior by preventing to close modal by clicking
outside of it. Buttons should be used and flow is now fixed.

Closes #25174 .
This commit is contained in:
Adrien Peiffer (ACSONE)
2018-06-11 11:23:28 +02:00
committed by Thibault Delavallée
parent 56e8a4a82a
commit 52f5bb27ce
@@ -35,12 +35,16 @@ var EventRegistrationForm = Widget.extend({
return;
}
var $modal = $(modal);
$modal.modal({backdrop: 'static', keyboard: false});
$modal.find('.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19
$modal.insertAfter($form).modal();
$modal.on('click', '.js_goto_event', function () {
$modal.modal('hide');
$button.prop('disabled', false);
});
$modal.on('click', '.close', function () {
$button.prop('disabled', false);
});
});
},
});