From 3ed3537abd416ebc35f8bc2ee65f209840c071bf Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 27 Oct 2020 14:08:33 +0000 Subject: [FIX] web_editor: encourage to use snippets in empty oe_structure (wizz) Make the draggable snippets "wizz" when the user clicks on an empty oe_structure. Part of https://github.com/odoo/odoo/pull/60837 Related to task-2363616 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/web_editor/static/src/js') 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 961233a477b..2f69ca64685 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1032,6 +1032,13 @@ var SnippetsMenu = Widget.extend({ if ($target.closest(this._notActivableElementsSelector).length) { return; } + const $oeStructure = $target.closest('.oe_structure'); + if ($oeStructure.length && !$oeStructure.children().length && this.$snippets) { + // If empty oe_structure, encourage using snippets in there by + // making them "wizz" in the panel. + this.$snippets.odooBounce(); + return; + } this._activateSnippet($target); }); -- cgit v1.2.3