Make editableWidget to set height when in edit mode

This commit is contained in:
Hadi Nategh 2019-02-27 11:00:53 +01:00
parent 5f65cecda5
commit b4d5584fe7
2 changed files with 10 additions and 5 deletions

View File

@ -41,6 +41,11 @@ var et2_editableWidget = (function(){ "use strict"; return et2_inputWidget.exten
type: "string",
default: et2_no_init,
description: "Additional parameters passed to save_callback"
},
editable_height: {
name: "Editable height",
description: "Set height for widget while in edit mode",
type: "string"
}
},

View File

@ -22,18 +22,18 @@
var et2_htmlarea = (function(){ "use strict"; return et2_editableWidget.extend([et2_IResizeable],
{
attributes: {
'mode': {
mode: {
'name': 'Mode',
'description': 'One of {ascii|simple|extended|advanced}',
'default': '',
'type': 'string'
},
'height': {
height: {
'name': 'Height',
'default': et2_no_init,
'type': 'string'
},
'width': {
width: {
'name': 'Width',
'default': et2_no_init,
'type': 'string'
@ -214,7 +214,7 @@ var et2_htmlarea = (function(){ "use strict"; return et2_editableWidget.extend([
this.options.readonly = _value;
if(this.options.readonly)
{
this.editor.remove();
if (this. editor) this.editor.remove();
this.htmlNode = jQuery(document.createElement(this.options.readonly ? "div" : "textarea"))
.css('height', this.options.height)
.addClass('et2_textbox_ro');
@ -227,7 +227,7 @@ var et2_htmlarea = (function(){ "use strict"; return et2_editableWidget.extend([
if(!this.editor)
{
this.htmlNode = jQuery(document.createElement("textarea"))
.css('height', this.options.height)
.css('height', (this.options.editable_height ? this.options.editable_height : this.options.height))
.val(value);
this.setDOMNode(this.htmlNode[0]);
this.init_editor();