summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/snippets.editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.editor.js')
-rw-r--r--addons/web_editor/static/src/js/snippets.editor.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js
index 19f60a25741..3f7561a8d98 100644
--- a/addons/web_editor/static/src/js/snippets.editor.js
+++ b/addons/web_editor/static/src/js/snippets.editor.js
@@ -827,9 +827,13 @@ data.Editor = Class.extend({
this.load_style_options();
// Initialize move/clone/remove buttons
- this.$overlay.on('click', '.oe_snippet_clone', _.bind(this.on_clone, this));
- this.$overlay.on('click', '.oe_snippet_remove', _.bind(this.on_remove, this));
- this._drag_and_drop();
+ if (!this.$target.parent().is(':o_editable')) {
+ this.$overlay.find('.oe_snippet_move, .oe_snippet_clone, .oe_snippet_remove').remove();
+ } else {
+ this.$overlay.on('click', '.oe_snippet_clone', _.bind(this.on_clone, this));
+ this.$overlay.on('click', '.oe_snippet_remove', _.bind(this.on_remove, this));
+ this._drag_and_drop();
+ }
},
getName: function () {
@@ -973,7 +977,11 @@ data.Editor = Class.extend({
self.styles[option].start();
self.styles[option].__order = i++;
});
- $ul.append($("<li/>", {"class": "divider"}));
+ if ($ul.children().length > 1) {
+ $ul.append($("<li/>", {"class": "divider"}));
+ } else {
+ $ul.empty();
+ }
var $parents = this.$target.parents();
_.each($parents, function (parent) {