summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2019-03-25 16:44:32 +0000
committerNicolas Lempereur <nle@odoo.com>2019-03-25 16:58:06 +0000
commit5838e47ab504340abc00ade9b8a18289aba1c03a (patch)
tree950720c5c3d666f2044f1e700093d8002d1882cb /addons/web/static/src
parente9068c290b3ca16e5e2ac9c2e30d824c7a655b62 (diff)
[FIX] web: modal in modal => no block mobile
On a form view: - we open a modal form view - in this modal we open a modal form view - we close that second modal => the modal is closed and the first one is still opened, but on mobile we can't scroll to above or below the modal. This is because bootstrap remove .modal-open class on body when we close the second modal, but this class is necessary to scroll (this is not much an issue on desktop since scroll is often not necessary). We already had a fix that was weakened in 02a063fd73. With this changeset, we keep .modal-open as long as a modal is opened. Without the change, added test failed with: 10. Modal is said opened (expected: true, result: false) opw-1948423 closes #32106 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/core/dialog.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js
index 5ba24f57cad..5335689b0b0 100644
--- a/addons/web/static/src/js/core/dialog.js
+++ b/addons/web/static/src/js/core/dialog.js
@@ -204,13 +204,13 @@ var Dialog = Widget.extend({
this.$modal.remove();
}
- if (!isFocusSet) {
- var modals = $('body > .modal').filter(':visible');
- if (modals.length) {
+ var modals = $('body > .modal').filter(':visible');
+ if (modals.length) {
+ if (!isFocusSet) {
modals.last().focus();
- // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal
- $('body').addClass('modal-open');
}
+ // Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal
+ $('body').addClass('modal-open');
}
},
/**