[FIX] web_editor, *: remove some inner content dropzones in Carousel

*: website

When dragging inner contents, dropzones appear in the Carousel snippet,
allowing to drop them directly in the element with the `row` class,
where it should not be the case. This is due to the `content` class
present on these elements and to the drop-in rule for inner contents
that allows them to be dropped in elements having this class.

This commit fixes this issue:
- in stable: as the XML files cannot be modified, the drop-in rule is
patched in JS to exclude the elements having both the `content` and
`row` classes.

- in master: it removes the `content` classes from the rows of the
Carousel snippet. It also removes this class from the drop-in rule,
as only Carousel was concerned by it.

See [1] for the following of this fix in design-themes.

[1]: https://github.com/odoo/design-themes/pull/603

task-3011192

closes odoo/odoo#108646

X-original-commit: 882c483ec1107879cd1c5693ea5cfce08e3220cc
Related: odoo/design-themes#628
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Soukéina Bojabza
2022-12-28 11:42:51 +01:00
parent 131948aca5
commit dba127d626
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -16,7 +16,7 @@
<!-- #01 -->
<div class="carousel-item active oe_img_bg o_bg_img_center pt152 pb152" style="background-image: url('/web/image/website.s_carousel_default_image_1');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row content">
<div class="row">
<div class="carousel-content col-lg-6">
<h2><font style="font-size: 62px;">Slide Title</font></h2>
<p class="lead">Use this snippet to presents your content in a slideshow-like format. Don't write about products or services here, write about solutions.</p>
@@ -30,7 +30,7 @@
<!-- #02 -->
<div class="carousel-item oe_img_bg o_bg_img_center pt96 pb96" style="background-image: url('/web/image/website.s_carousel_default_image_2');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row content">
<div class="row">
<div class="carousel-content col-lg-8 offset-lg-2 bg-black-50 text-center pt48 pb40">
<h2 style="font-size: 62px;">Clever Slogan</h2>
<div class="s_hr pt8 pb24" data-snippet="s_hr" data-name="Separator">
@@ -45,7 +45,7 @@
<!-- #03 -->
<div class="carousel-item oe_img_bg o_bg_img_center pt128 pb128" style="background-image: url('/web/image/website.s_carousel_default_image_3');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row content">
<div class="row">
<div class="carousel-content col-lg-6 offset-lg-6">
<h2><font style="font-size: 62px; background-color: rgb(255, 255, 255);">Edit this title</font></h2>
<h4><font style="background-color: rgb(255, 255, 255);">Good writing is simple, but not simplistic.</font></h4>
+1 -1
View File
@@ -641,7 +641,7 @@
<div id="so_content_addition"
t-att-data-selector="so_content_addition_selector"
t-attf-data-drop-near="p, h1, h2, h3, ul, ol, .row > div:not(.o_grid_item_image) > img, #{so_content_addition_selector}"
data-drop-in=".content, nav"/>
data-drop-in="nav"/>
<div data-js="SnippetSave"
data-selector="[data-snippet]"