From 52f5bb27cedf20caca7f60310fdc64cb8a716c1b Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Sun, 10 Jun 2018 13:24:49 +0200 Subject: [PATCH] [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 . --- addons/website_event/static/src/js/website_event.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js index 81192b03e0f..1db875927b7 100644 --- a/addons/website_event/static/src/js/website_event.js +++ b/addons/website_event/static/src/js/website_event.js @@ -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); + }); }); }, });