From 876a7aad0b2b30889ee5768459d1b2f0a0c1a33f Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Wed, 22 Jan 2020 16:50:54 +0000 Subject: [PATCH] [FIX] web_editor: fix move snippet hiding The move snippet arrows where not hiding properly when the target was not movable. closes odoo/odoo#43864 X-original-commit: ab32882ff0ecaf9995e52b062b880cd8ea0b6efa Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- addons/web_editor/static/src/scss/wysiwyg_snippets.scss | 4 ++-- addons/web_editor/static/src/xml/snippets.xml | 5 +++-- addons/website/static/src/js/editor/snippets.options.js | 2 +- 4 files changed, 7 insertions(+), 6 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 57ab6c37b73..7fc439e88a2 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -96,7 +96,7 @@ var SnippetEditor = Widget.extend({ }, }); } else { - this.$('.o_move_handle').addClass('d-none'); + this.$('.o_overlay_move_options').addClass('d-none'); $customize.find('.oe_snippet_clone').addClass('d-none'); } diff --git a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss index b8e87ff69f5..c6d1e8fa394 100644 --- a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss +++ b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss @@ -837,7 +837,7 @@ body.editor_enable.editor_has_snippets { } } - > .o_overlay_options { + > .o_overlay_move_options { @include o-position-absolute($o-we-handles-offset-to-hide, $left: 50%); transform: translate(-50%, -110%); display: flex; @@ -928,7 +928,7 @@ body.editor_enable.editor_has_snippets { } } - .o_overlay_options { + .o_overlay_move_options { display: none; } } diff --git a/addons/web_editor/static/src/xml/snippets.xml b/addons/web_editor/static/src/xml/snippets.xml index 3a17fc2bcf2..77e4686ae7e 100644 --- a/addons/web_editor/static/src/xml/snippets.xml +++ b/addons/web_editor/static/src/xml/snippets.xml @@ -9,8 +9,9 @@
- -
+ +
+
diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 5468ab9f321..0dbe26b024f 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -1165,7 +1165,7 @@ options.registry.SnippetMove = options.Class.extend({ */ start: function () { var $buttons = this.$el.find('we-button'); - var $overlayArea = this.$overlay.find('.o_overlay_options'); + var $overlayArea = this.$overlay.find('.o_overlay_move_options'); $overlayArea.prepend($buttons[0]); $overlayArea.append($buttons[1]);