X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/docs/source/TextArea.html?ds=inline diff --git a/docs/source/TextArea.html b/docs/source/TextArea.html index 8bc7294c..706578f0 100644 --- a/docs/source/TextArea.html +++ b/docs/source/TextArea.html @@ -1,11 +1,18 @@ - -
-/** + + + ++ \ No newline at end of fileThe source code + + + + +/*! + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +/** * @class Ext.form.TextArea * @extends Ext.form.TextField * Multiline text field. Can be used as a direct replacement for traditional textarea fields, plus adds @@ -27,13 +34,13 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { */ growMax: 1000, growAppend : ' \n ', - growPad : Ext.isWebKit ? -6 : 0, enterIsSpecial : false, /** * @cfg {Boolean} preventScrollbars true to prevent scrollbars from appearing regardless of how much text is - * in the field (equivalent to setting overflow: hidden, defaults to false) + * in the field. This option is only relevant when {@link #grow} is true. Equivalent to setting overflow: hidden, defaults to + * false. */ preventScrollbars: false, /** @@ -65,7 +72,7 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { }, onDestroy : function(){ - Ext.destroy(this.textSizeEl); + Ext.removeNode(this.textSizeEl); Ext.form.TextArea.superclass.onDestroy.call(this); }, @@ -74,13 +81,10 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { this.fireEvent("specialkey", this, e); } }, - + // private - onKeyUp : function(e){ - if(!e.isNavKeyPress() || e.getKey() == e.ENTER){ - this.autoSize(); - } - Ext.form.TextArea.superclass.onKeyUp.call(this, e); + doAutoSize : function(e){ + return !e.isNavKeyPress() || e.getKey() == e.ENTER; }, /** @@ -91,23 +95,22 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { if(!this.grow || !this.textSizeEl){ return; } - var el = this.el; - var v = el.dom.value; - var ts = this.textSizeEl; - ts.innerHTML = ''; - ts.appendChild(document.createTextNode(v)); - v = ts.innerHTML; + var el = this.el, + v = Ext.util.Format.htmlEncode(el.dom.value), + ts = this.textSizeEl, + h; + Ext.fly(ts).setWidth(this.el.getWidth()); if(v.length < 1){ v = " "; }else{ v += this.growAppend; if(Ext.isIE){ - v = v.replace(/\n/g, '- +Ext.reg('textarea', Ext.form.TextArea);
'); + v = v.replace(/\n/g, '
'); } } ts.innerHTML = v; - var h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin) + this.growPad); + h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin)); if(h != this.lastHeight){ this.lastHeight = h; this.el.setHeight(h); @@ -115,6 +118,6 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { } } }); -Ext.reg('textarea', Ext.form.TextArea);