From f504bb7bc33da5b121492a92e4a2ae4ec88db009 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 27 Oct 2023 12:05:00 +0200 Subject: [PATCH] [FIX] web_editor: fix custom snippets thumbnail This commit fixes 3 issues with the custom snippets thumbnail: - The tooltip ("Drag and drop the building block") appears during edition of the name of the custom snippet, it should not. - There was no space between the "Confirm" and "Cancel" buttons when editing the name of the custom snippet. - Starting from version 16.2 (although already fixed in the 16.0 commit), the "Cancel" button was positioned below the "Confirm" button instead of being on the same line. This was due to JQuery 3.6.3, which no longer correctly supported self-closing elements like "" for this particular issue. task-3572270 closes odoo/odoo#140998 X-original-commit: 9f682306a9d4c1fc9bcd55a41d411ccc190573ad Signed-off-by: Benoit Socias (bso) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 7 ++++--- addons/web_editor/static/src/scss/wysiwyg_snippets.scss | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 9fddb11cff3..4ba9d6c8379 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -4024,8 +4024,8 @@ var SnippetsMenu = Widget.extend({
- - + +
`); @@ -4079,7 +4079,8 @@ var SnippetsMenu = Widget.extend({ */ _onMouseUp(ev) { const snippetEl = ev.target.closest('.oe_snippet'); - if (snippetEl) { + if (snippetEl && !snippetEl.querySelector(".o_we_already_dragging") + && !ev.target.matches(".o_rename_btn")) { this._showSnippetTooltip($(snippetEl)); } }, diff --git a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss index f6c099f50a3..b2f10e8b87f 100644 --- a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss +++ b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss @@ -451,6 +451,7 @@ @extend %we-generic-clickable; cursor: pointer; flex: 1 1 auto; + padding: 0 $o-we-sidebar-content-field-button-group-button-spacing; line-height: 17px; text-align: center;