From b4ee432d11e1ab60f85de0e9edd4e38024212458 Mon Sep 17 00:00:00 2001 From: xO-Tx Date: Wed, 29 Nov 2023 16:33:46 +0100 Subject: [PATCH] [FIX] website: fix animated text selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Outagant Mehdi (mou) --- addons/website/static/src/js/editor/snippets.options.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index bb907e6f42b..f036bb706e0 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -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.