From d3a7edaec4ad8224345a1f02f8add5547f27b359 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 3 Jan 2019 11:10:54 +0000 Subject: [PATCH] [FIX] web, website: set correct order on modal footer button Since 12.0, some modal footer button order were changed. The primary button would not be the one in the modal footer corner. This is against bootstrap but more annoyingly, users are intuitively clicking on the secondary button, ending up closing the modal and losing form information they entered. This commit simply fix the regression from 12.0 as before 12.0 these buttons were positionned correctly. Note that a commit in master (saas-12.2) will fix all the other ones that were wrongly positionned before 12.0. Step to reproduce: - Go to an event having the possibility to register. - Click on 'Register Now', a modal is shown to write details (name, email..) - You intuitively click on 'Cancel' as it is the bottom right button |________________________________ CONFIRM _ CANCEL _| - The modal is closed, if you try to open it again your infos are lost Closes #29884 task-1922120 --- addons/web/static/src/js/core/dialog.js | 6 +++++- addons/website/static/src/scss/website.scss | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js index 492ea06c7bd..83eded92c8a 100644 --- a/addons/web/static/src/js/core/dialog.js +++ b/addons/web/static/src/js/core/dialog.js @@ -143,7 +143,11 @@ var Dialog = Widget.extend({ $.when(def).always(self.close.bind(self)); } }); - self.$footer.append($button); + if (self.technical) { + self.$footer.append($button); + } else { + self.$footer.prepend($button); + } }); }, diff --git a/addons/website/static/src/scss/website.scss b/addons/website/static/src/scss/website.scss index 09946969873..3b95a9f06cf 100644 --- a/addons/website/static/src/scss/website.scss +++ b/addons/website/static/src/scss/website.scss @@ -1066,3 +1066,8 @@ table.table_desc tr td { background-color: rgba($value, 0.1); } } + +// TODO: Will be handled properly in master/saas-12.2, temp fix for website_event.registration_attendee_details +.modal-footer > .float-left { + margin-right: auto; +}