From 5f197e76f422800edbef1097dce07973e971afe0 Mon Sep 17 00:00:00 2001 From: "Robin Lejeune (role)" Date: Tue, 11 Apr 2023 09:40:24 +0000 Subject: [PATCH] [FIX] web_editor: fix HTML/CSS editor resizing bug Starting on version 16.0, the HTML/CSS editor is very hard to resize. This is due to 16.0 introducing an iframe for the website: as soon as your mouse enters the iframe, the editor loses focus and cannot be resized anymore. This commit fixes that. task-3006138 closes odoo/odoo#120729 X-original-commit: e489abeffc72293544acb18eba23b52ed2224d60 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/common/ace.js | 2 ++ addons/web_editor/static/src/scss/web_editor.common.scss | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/addons/web_editor/static/src/js/common/ace.js b/addons/web_editor/static/src/js/common/ace.js index c69d795de2c..5f4275b7189 100644 --- a/addons/web_editor/static/src/js/common/ace.js +++ b/addons/web_editor/static/src/js/common/ace.js @@ -338,10 +338,12 @@ var ViewEditor = Widget.extend({ function startResizing(e) { refX = e.pageX; resizing = true; + document.body.classList.add("o_ace_view_editor_resizing"); } function stopResizing() { if (resizing) { resizing = false; + document.body.classList.remove("o_ace_view_editor_resizing"); if (this.errorSession) { // To trigger an update of the error display diff --git a/addons/web_editor/static/src/scss/web_editor.common.scss b/addons/web_editor/static/src/scss/web_editor.common.scss index b8c1ee47265..e546c06de3b 100644 --- a/addons/web_editor/static/src/scss/web_editor.common.scss +++ b/addons/web_editor/static/src/scss/web_editor.common.scss @@ -485,6 +485,10 @@ a.o_underline { } } +.o_ace_view_editor_resizing iframe { + pointer-events: none; +} + .o_ace_error_popover { max-width: 40vw;