From c498dfcb1999ee0e486bf0a5f12e7a1ffa4c4e84 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Fri, 11 Dec 2020 16:02:50 +0000 Subject: [PATCH] [IMP] web_editor: update Jabberwock library to commit 3bbb175c Changelog: [IMP] Odoo: add option to wrap the main zone X-original-commit: 3fff28df08678a1ca4f5b60d5d96bfeb6115f31c --- .../static/lib/jabberwock/jabberwock.js | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/addons/web_editor/static/lib/jabberwock/jabberwock.js b/addons/web_editor/static/lib/jabberwock/jabberwock.js index 1e31b72f24b..25ab910c192 100644 --- a/addons/web_editor/static/lib/jabberwock/jabberwock.js +++ b/addons/web_editor/static/lib/jabberwock/jabberwock.js @@ -24023,6 +24023,9 @@ odoo.define('web_editor.jabberwock', (function(require) { class OdooWebsiteEditor extends JWEditor { constructor(options) { super(); + if (typeof options.wrapMain === 'undefined') { + options.wrapMain = true; + } class CustomPlugin extends JWPlugin { constructor() { super(...arguments); @@ -24152,14 +24155,23 @@ odoo.define('web_editor.jabberwock', (function(require) { { id: 'main', render: async () => { - const div = new DividerNode(); - div.modifiers.get(Attributes).set('contentEditable', 'true'); - div.modifiers.get(Attributes).classList.add('note-editable', 'o_editable'); - div.modifiers.get(Attributes).style.set('width', '100%'); - const zone = new ZoneNode({ managedZones: ['editable'] }); - zone.editable = true; - div.append(zone); - return [div]; + if (options.wrapMain) { + const div = new DividerNode(); + div.modifiers.get(Attributes).set('contentEditable', 'true'); + div.modifiers + .get(Attributes) + .classList.add('note-editable', 'o_editable'); + div.modifiers.get(Attributes).style.set('width', '100%'); + const zone = new ZoneNode({ managedZones: ['editable'] }); + zone.editable = true; + div.append(zone); + return [div]; + } + else { + const zone = new ZoneNode({ managedZones: ['editable'] }); + zone.editable = true; + return [zone]; + } }, }, {