diff options
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 13 |
1 files changed, 12 insertions, 1 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 2f69ca64685..5e25ecd32a7 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -870,6 +870,7 @@ var SnippetsMenu = Widget.extend({ id: 'oe_snippets', cacheSnippetTemplate: {}, events: { + 'click .oe_snippet': '_onSnippetClick', 'click .o_install_btn': '_onInstallBtnClick', 'click .o_we_add_snippet_btn': '_onBlocksTabClick', 'click .o_we_invisible_entry': '_onInvisibleEntryClick', @@ -1930,7 +1931,6 @@ var SnippetsMenu = Widget.extend({ const smoothScrollOptions = this._getScrollOptions({ jQueryDraggableOptions: { - distance: 0, handle: '.oe_snippet_thumbnail:not(.o_we_already_dragging)', helper: function () { const dragSnip = this.cloneNode(true); @@ -2490,6 +2490,17 @@ var SnippetsMenu = Widget.extend({ }, /** * @private + */ + _onSnippetClick() { + const $els = this.getEditableArea().find('.oe_structure.oe_empty').addBack('.oe_structure.oe_empty'); + for (const el of $els) { + if (!el.children.length) { + $(el).odooBounce('o_we_snippet_area_animation'); + } + } + }, + /** + * @private * @param {OdooEvent} ev * @param {Object} ev.data * @param {function} ev.data.exec |
