diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css index 48400b88d45..4121b70ef2e 100644 --- a/addons/website/static/src/css/snippets.css +++ b/addons/website/static/src/css/snippets.css @@ -345,7 +345,10 @@ box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7); } .oe_overlay .oe_handle.readonly { - content: ""; + cursor: auto !important; +} +.oe_overlay .oe_handle.readonly:before, .oe_overlay .oe_handle.readonly.size { + display: none !important; } .oe_overlay .icon.btn { display: inline-block; diff --git a/addons/website/static/src/css/snippets.sass b/addons/website/static/src/css/snippets.sass index 0c4abe362e2..d7442a5b0f7 100644 --- a/addons/website/static/src/css/snippets.sass +++ b/addons/website/static/src/css/snippets.sass @@ -253,7 +253,9 @@ color: #fff +box-shadow(0 0 5px 3px rgba(255,255,255,.7)) &.readonly - content: "" + cursor: auto !important + &:before, &.size + display: none !important .icon.btn display: inline-block diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index f3c702e7be3..bc7c6db15d1 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -180,10 +180,10 @@ 'top': pos.top - mt - 5, 'left': pos.left }); - $el.find(">.e,>.w").css({'height': $target.outerHeight() + mt + mb+1}); - $el.find(">.s").css({'top': $target.outerHeight() + mt + mb}); - $el.find(">.size").css({'top': $target.outerHeight() + mt}); - $el.find(">.s,>.n").css({'width': $target.outerWidth()-2}); + $el.find(".oe_handle.e,.oe_handle.w").css({'height': $target.outerHeight() + mt + mb+1}); + $el.find(".oe_handle.s").css({'top': $target.outerHeight() + mt + mb}); + $el.find(".oe_handle.size").css({'top': $target.outerHeight() + mt}); + $el.find(".oe_handle.s,.oe_handle.n").css({'width': $target.outerWidth()-2}); }, show: function () { this.$el.removeClass("hidden"); @@ -969,16 +969,13 @@ start: function () { var self = this; this._super(); - var $box = $(openerp.qweb.render("website.snippets.resize")); var resize_values = this.getSize(); - if (!resize_values.n) $box.find(".oe_handle.n").remove(); - if (!resize_values.s) $box.find(".oe_handle.s").remove(); - if (!resize_values.e) $box.find(".oe_handle.e").remove(); - if (!resize_values.w) $box.find(".oe_handle.w").remove(); - if (!resize_values.size) $box.find(".oe_handle.size").remove(); - - this.$overlay.append($box.find(".oe_handles").html()); + if (resize_values.n) this.$overlay.find(".oe_handle.n").removeClass("readonly"); + if (resize_values.s) this.$overlay.find(".oe_handle.s").removeClass("readonly"); + if (resize_values.e) this.$overlay.find(".oe_handle.e").removeClass("readonly"); + if (resize_values.w) this.$overlay.find(".oe_handle.w").removeClass("readonly"); + if (resize_values.size) this.$overlay.find(".oe_handle.size").removeClass("readonly"); this.$overlay.find(".oe_handle:not(:has(.oe_handle_button)), .oe_handle .oe_handle_button").on('mousedown', function (event){ event.preventDefault(); diff --git a/addons/website/static/src/xml/website.snippets.xml b/addons/website/static/src/xml/website.snippets.xml index ae109139e3c..4a9769203ef 100644 --- a/addons/website/static/src/xml/website.snippets.xml +++ b/addons/website/static/src/xml/website.snippets.xml @@ -34,6 +34,13 @@ +