diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-06-09 08:28:20 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-06-09 10:52:26 +0000 |
| commit | 117552f09764685b4efccf1bf910fc27f8741d9d (patch) | |
| tree | 2f5a7e5869f7d480f2b60fd2ee6e4ac946572cd2 /addons | |
| parent | 4fda0f43b74636849d5cc1d0e9f13ed70e032113 (diff) | |
[FIX] web_editor: properly cover modal snippets
When a snippet contains a modal, the editor overlay should not cover the
0-height wrapping div but the modal element itself.
Part of https://github.com/odoo/odoo/pull/52663
X-original-commit: bc055e7822b9b2e7f8f9608e335456a71d7896a1
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 1376e6f76e7..eda2b4b3fc3 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -198,16 +198,18 @@ var SnippetEditor = Widget.extend({ if (!this.isShown() || !this.$target.length || !this.$target.is(':visible')) { return; } - var offset = this.$target.offset(); + const $modal = this.$target.find('.modal'); + const $target = $modal.length ? $modal : this.$target; + const offset = $target.offset(); var manipulatorOffset = this.$el.parent().offset(); offset.top -= manipulatorOffset.top; offset.left -= manipulatorOffset.left; this.$el.css({ - width: this.$target.outerWidth(), + width: $target.outerWidth(), left: offset.left, top: offset.top, }); - this.$('.o_handles').css('height', this.$target.outerHeight()); + this.$('.o_handles').css('height', $target.outerHeight()); this.$el.toggleClass('o_top_cover', offset.top < this.$editable.offset().top); }, /** |
