diff --git a/sao/src/sao.less b/sao/src/sao.less index bac1b8d556..89a8baa2b8 100644 --- a/sao/src/sao.less +++ b/sao/src/sao.less @@ -636,7 +636,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 39cfb4d9a4..523a81c23f 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -2149,10 +2149,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)); if (this.attributes.translate) { var button = jQuery('', { @@ -2161,7 +2164,7 @@ function eval_pyson(value){ 'aria-label': 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)); @@ -2235,13 +2238,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', @@ -2249,7 +2255,7 @@ function eval_pyson(value){ 'aria-label': 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));