Maintainers
This module is maintained by the OCA.
-
+
+
+
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
diff --git a/web_form_view_resizable/static/src/js/form_view_resizable.esm.js b/web_form_view_resizable/static/src/js/form_view_resizable.esm.js index e6e320c858e6..fd1f79500db1 100644 --- a/web_form_view_resizable/static/src/js/form_view_resizable.esm.js +++ b/web_form_view_resizable/static/src/js/form_view_resizable.esm.js @@ -10,8 +10,18 @@ patch(FormRenderer.prototype, "web_form_view_resizable", { _mounted() { $("div.o_form_view_container").resizable({ handles: "e", - minWidth: 400, - maxWidth: 1200, + minWidth: window.innerWidth * 0.1, + maxWidth: window.innerWidth * 0.9, + classes: { + "ui-resizable": "remove_flex", + }, + // Allow user to drag over the preview of a pdf + start: function () { + $("div.o_attachment_preview").addClass("remove_hover_effect"); + }, + stop: function () { + $("div.o_attachment_preview").removeClass("remove_hover_effect"); + }, }); }, }); diff --git a/web_form_view_resizable/static/src/scss/form_view_resizable.scss b/web_form_view_resizable/static/src/scss/form_view_resizable.scss new file mode 100644 index 000000000000..6b68135ea3b9 --- /dev/null +++ b/web_form_view_resizable/static/src/scss/form_view_resizable.scss @@ -0,0 +1,11 @@ +// Unset flex property otherwise, when clicking on handler, +// the div tries to grow before actually dragging the div +.remove_flex { + flex: unset !important; +} + +// Unset pointer-event while dragging otherwise, +// when hovering the div while dragging, it will stop the scaling of the div +.remove_hover_effect { + pointer-events: none !important; +}