diff --git a/addons/project/static/src/js/widgets/html_with_action_widget.js b/addons/project/static/src/js/widgets/html_with_action_widget.js index 19b3c659506..e56a79f712d 100644 --- a/addons/project/static/src/js/widgets/html_with_action_widget.js +++ b/addons/project/static/src/js/widgets/html_with_action_widget.js @@ -15,9 +15,8 @@ export const FieldHtmlWithAction = FieldHtml.extend({ bus.on("DOM_updated", this, () => { const $editable = this.$el.find('.note-editable'); if ($editable.length) { - const resizerHeight = this.$el.find('.o_wysiwyg_resizer').outerHeight(); - const newHeight = window.innerHeight - $editable.offset().top - resizerHeight - 1; - $editable.outerHeight(newHeight); + const minHeight = window.innerHeight - $editable.offset().top - 30; + $editable.css('min-height', minHeight + 'px'); } }); } diff --git a/addons/project/static/src/scss/project_form.scss b/addons/project/static/src/scss/project_form.scss index 84602ce6e3d..38c4933a363 100644 --- a/addons/project/static/src/scss/project_form.scss +++ b/addons/project/static/src/scss/project_form.scss @@ -5,7 +5,7 @@ .o_form_project_project, .o_form_project_tasks { .note-editable { border: 0; - padding: $o-horizontal-padding $o-horizontal-padding; + padding: 0; } } diff --git a/addons/web/static/src/legacy/scss/form_view.scss b/addons/web/static/src/legacy/scss/form_view.scss index 96f020c8060..c46c1c8556f 100644 --- a/addons/web/static/src/legacy/scss/form_view.scss +++ b/addons/web/static/src/legacy/scss/form_view.scss @@ -654,6 +654,17 @@ $o-form-label-margin-right: 0px; .tab-content > .tab-pane { padding: $o-horizontal-padding 0; + >.oe_form_field { + >.note-editable { + border-width: 0; + padding: 0; + min-height: 180px; + } + &.oe-bordered-editor>.note-editable { + border-width: 1px; + padding: 4px; + } + } } } @@ -672,7 +683,7 @@ $o-form-label-margin-right: 0px; } .o_field_widget, .btn { .o_field_widget { - margin-bottom: 0px; + margin-bottom: 0; } } .o_td_label .o_form_label:not(.o_status), .o_checkbox_optional_field > .o_form_label { diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index edefbc23668..faf31618096 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -205,10 +205,11 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { noVideos: 'noVideos' in this.nodeOptions ? this.nodeOptions.noVideos : true, }, linkForceNewWindow: true, - tabsize: 0, - height: this.nodeOptions.height || 110, - resizable: 'resizable' in this.nodeOptions ? this.nodeOptions.resizable : true, + height: this.nodeOptions.height, + minHeight: this.nodeOptions.minHeight, + maxHeight: this.nodeOptions.maxHeight, + resizable: 'resizable' in this.nodeOptions ? this.nodeOptions.resizable : false, editorPlugins: [QWebPlugin], }); }, diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index c41a5301bd5..9d2477662b6 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -557,7 +557,15 @@ const Wysiwyg = Widget.extend({ renderElement: function () { this.$editable = this.options.editable || $('
'); this.$root = this.$editable; - + if (this.options.height) { + this.$editable.height(this.options.height); + } + if (this.options.minHeight) { + this.$editable.css('min-height', this.options.minHeight); + } + if (this.options.maxHeight && this.options.maxHeight > 10) { + this.$editable.css('max-height', this.options.maxHeight); + } if (this.options.resizable && !device.isMobile) { const $wrapper = $('
'); this.$root = $wrapper; diff --git a/addons/web_editor/static/src/scss/wysiwyg.scss b/addons/web_editor/static/src/scss/wysiwyg.scss index e09022331b3..6db5f18949f 100644 --- a/addons/web_editor/static/src/scss/wysiwyg.scss +++ b/addons/web_editor/static/src/scss/wysiwyg.scss @@ -708,7 +708,15 @@ img::selection { background: white; color: black; height: 100%; - padding: 5px 10px; + padding: 4px; + min-height: 10px; + border-radius: 3px; +} + +.oe-bordered-editor>.note-editable { + border-width: 1px; + padding: 4px; + min-height: 180px; } .o_we_no_pointer_events { @@ -809,4 +817,4 @@ img::selection { -webkit-line-clamp: unset; } } -} \ No newline at end of file +}