summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-10-27 14:08:33 +0000
committerqsm-odoo <qsm@odoo.com>2020-11-13 13:56:13 +0000
commit3ed3537abd416ebc35f8bc2ee65f209840c071bf (patch)
tree767a74cea0af7cb08873cc563736275c8dd0ea3b /addons/web_editor/static/src/js/editor
parentf869f782b8fe14cb6d85a5eae7a681a55bd2f8cf (diff)
[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
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js7
1 files changed, 7 insertions, 0 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 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);
});