diff --git a/sao/src/sao.less b/sao/src/sao.less index 8139510f67..a01ee296fb 100644 --- a/sao/src/sao.less +++ b/sao/src/sao.less @@ -724,7 +724,7 @@ img.icon { } } .form-text, .form-richtext { - > textarea, .richtext { + textarea, .richtext { height: 100%; line-height: 2.5ex; min-height: 12.5ex; diff --git a/sao/src/view/form.js b/sao/src/view/form.js index d7eef85b2a..8a52ca8d1d 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -2272,10 +2272,13 @@ function eval_pyson(value){ this.el = jQuery('
', { 'class': this.class_ }); + this.group = jQuery('', { + 'class': 'input-group', + }).appendTo(this.el); this.input = this.labelled = jQuery('', { 'class': 'form-control input-sm mousetrap', 'name': attributes.name, - }).appendTo(this.el); + }).appendTo(this.group); this.input.change(this.focus_out.bind(this)); this.input.on('keydown', this.send_modified.bind(this)); if (this.attributes.translate) { @@ -2286,7 +2289,7 @@ function eval_pyson(value){ 'title': Sao.i18n.gettext("Translate"), }).appendTo(jQuery('', { 'class': 'input-group-btn' - }).appendTo(this.el)); + }).appendTo(this.group)); button.append( Sao.common.ICONFACTORY.get_icon_img('tryton-translate')); button.click(this.translate.bind(this)); @@ -2362,13 +2365,16 @@ function eval_pyson(value){ 'class': 'panel-heading', }).appendTo(this.el)); } + this.group = jQuery('', { + 'class': 'input-group', + }).appendTo(jQuery('', { + 'class': 'panel-body', + }).appendTo(this.el)); this.input = this.labelled = jQuery('', { 'class': 'richtext mousetrap', - 'contenteditable': true - }).appendTo(jQuery('', { - 'class': 'panel-body' - }).appendTo(this.el)); - this.el.focusout(this.focus_out.bind(this)); + 'contenteditable': true, + }).appendTo(this.group); + this.group.focusout(this.focus_out.bind(this)); if (this.attributes.translate) { var button = jQuery('', { 'class': 'btn btn-default btn-sm form-control', @@ -2377,7 +2383,7 @@ function eval_pyson(value){ 'title': Sao.i18n.gettext("Translate"), }).appendTo(jQuery('', { 'class': 'input-group-btn', - }).appendTo(this.el)); + }).appendTo(this.group)); button.append( Sao.common.ICONFACTORY.get_icon_img('tryton-translate')); button.click(this.translate.bind(this));