Skip to content
Snippets Groups Projects
Commit 398259c9 authored by Samuel Degueldre's avatar Samuel Degueldre
Browse files

[FIX] web_editor: fix replacing media leaving unexpected elements

Previously, changing a media from a video/icon/document to a different
type would leave empty elements in the DOM, this is because summernote's
range API `range.insertNode` function deletes the content but not the
structure (HTML elements).

This commit fixes that by using jQuery's replaceWith method instead of
summernote's insertNode when a media was found, and only using
summernote in case no media was found (eg. a text range).

Part of https://github.com/odoo/odoo/pull/64234

X-original-commit: 63f80995
parent a2cb36e8
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment