From b16ab7b9979743616ec2ee937f746cc2a00d710e Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Tue, 22 Aug 2023 14:48:49 +0200 Subject: [PATCH] [FIX] website: allow to re-edit social media title This commit allows you to change the title of the social media block after the first save. If an element is in a parent that has the class `o_not_editable` then it is only editable if it has the contenteditable attribute set to true. We rightfully remove this attribute at saving but without putting it back when we return to edit mode. This commit allows to fix this case. Note that we have to improve this system in the future (so we can get rid of this patch). This part of the fix is very similar to [this other fix] for the team block. [this other fix]: https://github.com/odoo/odoo/commit/b7d53d2fcb20a447fd3098adf94ffb33bc49dda9 task-3073171 closes odoo/odoo#134281 Part-of: odoo/odoo#105964 X-original-commit: 44b0bcbdd67721e3b45567d26da00e4a3910f541 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Guillaume Dieleman (gdi) --- .../static/src/components/wysiwyg_adapter/wysiwyg_adapter.js | 5 +++++ addons/website/views/snippets/s_social_media.xml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index 9ec17a1caba..3a58ef9450f 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -489,6 +489,11 @@ export class WysiwygAdapterComponent extends Wysiwyg { $extraEditableZones = $extraEditableZones.add($editableSavableZones .find('.s_social_media a > i')); + // TODO find a similar system for texts. + // grep: SOCIAL_MEDIA_TITLE_CONTENTEDITABLE + $extraEditableZones = $extraEditableZones.add($editableSavableZones + .find('.s_social_media .s_social_media_title')); + // To make sure the selection remains bounded to the active tab, // each tab is made non editable while keeping its nested // oe_structure editable. This avoids having a selection range span diff --git a/addons/website/views/snippets/s_social_media.xml b/addons/website/views/snippets/s_social_media.xml index 44d087c1c3f..c9cc55dfe0e 100644 --- a/addons/website/views/snippets/s_social_media.xml +++ b/addons/website/views/snippets/s_social_media.xml @@ -1,6 +1,10 @@ +