[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) <qsm@odoo.com>
This commit is contained in:
Robin Lejeune (role)
2023-05-09 11:57:19 +02:00
parent 4cd313306b
commit 5f197e76f4
2 changed files with 6 additions and 0 deletions
@@ -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
@@ -485,6 +485,10 @@ a.o_underline {
}
}
.o_ace_view_editor_resizing iframe {
pointer-events: none;
}
.o_ace_error_popover {
max-width: 40vw;