Implement resize function for htmlarea widget in order to cordinate htmlNode's height to window size

This commit is contained in:
Hadi Nategh 2015-02-03 11:22:06 +00:00
parent 30eefe4d20
commit 84560a0496

View File

@ -24,7 +24,7 @@
/** /**
* @augments et2_inputWidget * @augments et2_inputWidget
*/ */
var et2_htmlarea = et2_inputWidget.extend( var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
{ {
modes: ['ascii','simple','extended','advanced'], modes: ['ascii','simple','extended','advanced'],
@ -268,6 +268,20 @@ var et2_htmlarea = et2_inputWidget.extend(
this.egw().debug("error",e); this.egw().debug("error",e);
return null; return null;
} }
},
/**
* Resize htmlNode tag according to window size
* @param {type} _height excess height which comes from window resize
*/
resize: function (_height)
{
if (_height)
{
// apply the ratio
_height = (this.options.resize_ratio != '')? _height * this.options.resize_ratio: _height;
if (_height != 0) this.htmlNode.height(this.htmlNode.height() + _height);
}
} }
}); });
et2_register_widget(et2_htmlarea, ["htmlarea"]); et2_register_widget(et2_htmlarea, ["htmlarea"]);