diff options
Diffstat (limited to 'addons/web/static/src/js/core/dialog.js')
| -rw-r--r-- | addons/web/static/src/js/core/dialog.js | 10 |
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 8630b6b9364..807411144e9 100644 --- a/addons/web/static/src/js/core/dialog.js +++ b/addons/web/static/src/js/core/dialog.js @@ -231,13 +231,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'); } }, /** |
