summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/core/owl_dialog.js6
-rw-r--r--addons/web/static/src/scss/bootstrap_review.scss14
-rw-r--r--addons/web/static/src/scss/modal.scss5
-rw-r--r--addons/web/static/src/xml/base.xml3
4 files changed, 21 insertions, 7 deletions
diff --git a/addons/web/static/src/js/core/owl_dialog.js b/addons/web/static/src/js/core/owl_dialog.js
index daa29468934..3572742a698 100644
--- a/addons/web/static/src/js/core/owl_dialog.js
+++ b/addons/web/static/src/js/core/owl_dialog.js
@@ -120,8 +120,12 @@ odoo.define('web.OwlDialog', function () {
/**
* @private
+ * @param {MouseEvent} ev
*/
- _onBackdropClick() {
+ _onBackdropClick(ev) {
+ if (!this.props.backdrop || ev.target !== ev.currentTarget) {
+ return;
+ }
if (this.props.backdrop === 'static') {
if (this.mainButton) {
this.mainButton.focus();
diff --git a/addons/web/static/src/scss/bootstrap_review.scss b/addons/web/static/src/scss/bootstrap_review.scss
index 8fab23b0b1a..75514a1065d 100644
--- a/addons/web/static/src/scss/bootstrap_review.scss
+++ b/addons/web/static/src/scss/bootstrap_review.scss
@@ -80,6 +80,20 @@
}
}
+// Do not display the backdrop element added by bootstrap in the body and add a
+// background on the modal to keep the same effect. The bootstrap backdrop was
+// probably useful for compatibility with <IE9 but is no longer needed. This
+// also avoids z-index issues because modals could be opened in an element
+// (e.g. the website #wrapwrap) whose stacking context is different of the body
+// one (where the backdrop is opened). This would make the backdrop appears on
+// top of the modal.
+.modal-backdrop {
+ display: none;
+}
+.modal:not([data-backdrop="false"]) {
+ background-color: rgba($modal-backdrop-bg, $modal-backdrop-opacity);
+}
+
// Restore pointer cursor which came with the 'btn' class until BS 4.3.1
.btn:not(:disabled):not(.disabled) {
cursor: pointer;
diff --git a/addons/web/static/src/scss/modal.scss b/addons/web/static/src/scss/modal.scss
index 29ce3f16578..e3331fe9f2c 100644
--- a/addons/web/static/src/scss/modal.scss
+++ b/addons/web/static/src/scss/modal.scss
@@ -118,11 +118,6 @@
> .modal {
display: block;
- pointer-events: none;
- }
-
- .modal-content {
- pointer-events: auto;
}
}
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 7cb009b95fb..fab3018fb46 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -461,12 +461,13 @@
<t t-name="web.OwlDialog" owl="1">
<Portal target="'body'">
<div class="o_dialog" t-on-focus="_onFocus" t-on-click="_onClick">
- <div t-if="props.backdrop" class="modal-backdrop show" t-on-click="_onBackdropClick"/>
<div role="dialog" class="modal"
tabindex="-1"
t-att-class="{ o_technical_modal: props.technical, o_modal_full: props.fullscreen }"
+ t-att-data-backdrop="'' + props.backdrop"
t-ref="modal"
t-on-close_dialog.stop="_close"
+ t-on-click="_onBackdropClick"
>
<div class="modal-dialog" t-att-class="size">
<div class="modal-content" t-att-class="props.contentClass">