From e8477eb90add4709f2b18c2e3dd626bd202c30f4 Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Mon, 20 Nov 2023 16:05:23 +0100 Subject: [PATCH] [FIX] web_editor: fix drag and drop tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since [commit 1], the tooltip that appears when a user clicks on a snippet (instead of dragging it) is no longer displayed. The reason is because [commit 1] replaced jQueryUI with Odoo's own code and that triggers `preventDefault` on the `pointerdown` event which then cancels `mousedown` and thus prevents the mousedown call back that displays the tooltip. To fix this, this commit replaces mousedown and mouseup events on the `SnippetsMenu` by pointerdown and pointerup. [commit 1]: https://github.com/odoo/odoo/commit/7594d71ca8610d5947e80f325ccb57abc23c2c76 task-3582562 closes odoo/odoo#141026 Signed-off-by: Soukéina Bojabza (sobo) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 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 4b150084929..4b12800a6f3 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1744,8 +1744,8 @@ var SnippetsMenu = Widget.extend({ 'click .o_we_invisible_entry': '_onInvisibleEntryClick', 'click #snippet_custom .o_rename_btn': '_onRenameBtnClick', 'click #snippet_custom .o_delete_btn': '_onDeleteBtnClick', - 'mousedown': '_onMouseDown', - 'mouseup': '_onMouseUp', + 'pointerdown': '_onMouseDown', + 'pointerup': '_onMouseUp', 'input .o_snippet_search_filter_input': '_onSnippetSearchInput', 'click .o_snippet_search_filter_reset': '_onSnippetSearchResetClick', 'click .o_we_website_top_actions button[data-action=save]': '_onSaveRequest',