X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/TextArea.html diff --git a/docs/source/TextArea.html b/docs/source/TextArea.html index f6b7d0dd..547b7f29 100644 --- a/docs/source/TextArea.html +++ b/docs/source/TextArea.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.form.TextArea * @extends Ext.form.TextField * Multiline text field. Can be used as a direct replacement for traditional textarea fields, plus adds @@ -33,7 +28,6 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { */ growMax: 1000, growAppend : ' \n ', - growPad : Ext.isWebKit ? -6 : 0, enterIsSpecial : false, @@ -72,7 +66,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); }, @@ -81,13 +75,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; },
/** @@ -98,23 +89,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, '
'); + 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); @@ -122,6 +112,6 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField, { } } }); -Ext.reg('textarea', Ext.form.TextArea);
- +Ext.reg('textarea', Ext.form.TextArea);
+ \ No newline at end of file