Skip to content
Snippets Groups Projects
Commit 9a20f73e authored by Guillaume (gdi)'s avatar Guillaume (gdi)
Browse files

[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#133860

Part-of: odoo/odoo#105964
X-original-commit: https://github.com/odoo/odoo/commit/ba485b12bf9bc02644e743c7f236ce6492f453bc


Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: default avatarGuillaume Dieleman (gdi) <gdi@odoo.com>
parent 0e6ca3e2
No related branches found
No related tags found
No related merge requests found
......@@ -379,6 +379,11 @@ export class WysiwygAdapterComponent extends ComponentAdapter {
$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
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
For the moment we hack the contenteditable system so that the social media
title stay editable after a save (see SOCIAL_MEDIA_TITLE_CONTENTEDITABLE).
-->
<template id="s_social_media" name="Social Media">
<div class="s_social_media text-start o_not_editable" contenteditable="false">
<h4 class="s_social_media_title d-none" contenteditable="true">Social Media</h4>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment