/*!
- * Ext JS Library 3.0.0
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
*/
/**
* @class Ext.form.TextArea
*/
growMax: 1000,
growAppend : ' \n ',
- growPad : Ext.isWebKit ? -6 : 0,
enterIsSpecial : false,
/**
* @cfg {Boolean} preventScrollbars <tt>true</tt> to prevent scrollbars from appearing regardless of how much text is
- * in the field (equivalent to setting overflow: hidden, defaults to <tt>false</tt>)
+ * in the field. This option is only relevant when {@link #grow} is <tt>true</tt>. Equivalent to setting overflow: hidden, defaults to
+ * <tt>false</tt>.
*/
preventScrollbars: false,
/**
},
onDestroy : function(){
- Ext.destroy(this.textSizeEl);
+ Ext.removeNode(this.textSizeEl);
Ext.form.TextArea.superclass.onDestroy.call(this);
},
this.fireEvent("specialkey", this, e);
}
},
-
+
// private
- onKeyUp : function(e){
- if(!e.isNavKeyPress() || e.getKey() == e.ENTER){
- this.autoSize();
+ doAutoSize : function(e){
+ return !e.isNavKeyPress() || e.getKey() == e.ENTER;
+ },
+
+ // inherit docs
+ filterValidation: function(e) {
+ if(!e.isNavKeyPress() || (!this.enterIsSpecial && e.keyCode == e.ENTER)){
+ this.validationTask.delay(this.validationDelay);
}
- Ext.form.TextArea.superclass.onKeyUp.call(this, e);
},
/**
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, '<br />');
+ v = v.replace(/\n/g, ' <br />');
}
}
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);