[FIX] website: fix animated text selection

The goal of this commit is to prevent the text animation overlay from
blocking small text content selection.

Remark: This behavior was already fixed on 17.0 (by [1]) for text
animations and highlights and was backported here for text animation
options.

[1]: https://github.com/odoo/odoo/commit/f64c9f27f1a9106bc009ad2f696845f2c5c58066

Related to task-3285817

closes odoo/odoo#144086

X-original-commit: b69e105149e5f0dc6a469068ab037b717e017144
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
This commit is contained in:
xO-Tx
2023-11-30 11:44:58 +00:00
parent f0e3682b80
commit b4ee432d11
@@ -3443,10 +3443,7 @@ options.registry.WebsiteAnimate = options.Class.extend({
this.isAnimatedText = this.$target.hasClass('o_animated_text');
this.$optionsSection = this.$overlay.data('$optionsSection');
this.$scrollingElement = $().getScrollingElement(this.ownerDocument);
if (this.isAnimatedText) {
this.$overlay[0].querySelectorAll(".o_handle")
.forEach(handle => handle.classList.add("pe-none"));
}
this.$overlay[0].querySelector(".o_handles").classList.toggle("pe-none", this.isAnimatedText);
},
/**
* @override
@@ -3729,8 +3726,7 @@ options.registry.TextHighlight = options.Class.extend({
this.leftPanelEl = this.$overlay.data("$optionsSection")[0];
// Reduce overlay opacity for more highlight visibility on small text.
this.$overlay[0].style.opacity = "0.25";
this.$overlay[0].querySelectorAll(".o_handle")
.forEach(handle => handle.classList.add("pe-none"));
this.$overlay[0].querySelector(".o_handles").classList.add("pe-none");
},
/**
* Move "Text Effect" options to the editor's toolbar.