roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 24 Apr 2014 06:32:55 +0000 (14:32 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 Apr 2014 06:32:55 +0000 (14:32 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index f072c12..a4f4ca5 100644 (file)
@@ -4490,7 +4490,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
        
         var parent = this.parent();
         
-        var align = parent.labelAlign;
+        var align = this.parentLabelAlign();
         
         var id = Roo.id();
         
index ffb671f..0943732 100644 (file)
@@ -104,7 +104,7 @@ this.el.addClass(this.invalidClass);this.fireEvent('invalid',this,A);},SafariOnK
 Roo.bootstrap.TextArea=function(A){Roo.bootstrap.TextArea.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TextArea,Roo.bootstrap.Input,{cols:false,rows:5,readOnly:false,warp:'soft',resize:false,getAutoCreate:function(){var A=this.parent();var B=A.labelAlign;var id=Roo.id();var C={};var D={tag:'textarea',id:id,warp:this.warp,rows:this.rows,value:this.value,cls:'form-control',placeholder:this.placeholder||''};if(this.resize){D.style=(typeof(D.style)=='undefined')?'resize:'+this.resize:D.style+'resize:'+this.resize;}if(this.cols){D.cols=this.cols;}if(this.readOnly){D.readonly=true;}if(this.name){D.name=this.name;}if(this.size){D.cls=(typeof(D.cls)=='undefined')?'input-'+this.size:D.cls+' input-'+this.size;}var E=this;['xs','sm','md','lg'].map(function(G){if(E[G]){C.cls+=' col-'+G+'-'+E[G];}});var F=D;if(this.before||this.after){F={cls:'input-group',cn:[]};if(this.before){F.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
 F.cn.push(D);if(this.after){F.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(B==='left'&&this.fieldLabel.length){Roo.log("left and has label");C.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel},{cls:"col-sm-"+(12-this.labelWidth),cn:[F]}];}else if(this.fieldLabel.length){Roo.log(" label");C.cn=[{tag:'label',html:this.fieldLabel},F];}else {Roo.log(" no label && no align");C.cn=[F];}if(this.disabled){D.disabled=true;}return C;},inputEl:function(){return this.el.select('textarea.form-control',true).first();}});
 //Roo/bootstrap/TriggerField.js
-Roo.bootstrap.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TriggerField,Roo.bootstrap.Input,{hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',getAutoCreate:function(){var A=this.parent();var B=A.labelAlign;var id=Roo.id();var C={cls:'form-group'};var D={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'off',placeholder:this.placeholder||''};if(this.name){D.name=this.name;}if(this.size){D.cls+=' input-'+this.size;}var E={cls:'combobox-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D,{tag:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'},{tag:'span',cls:'input-group-addon btn dropdown-toggle',cn:[{tag:'span',cls:'caret'},{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}]}]}]};if(B==='left'&&this.fieldLabel.length){Roo.log("left and has label");C.cn=[{tag:'label','for':id,cls:'col-sm-2 control-label',html:this.fieldLabel},{cls:"col-sm-10",cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");C.cn=[{tag:'label',html:this.fieldLabel},E];}else {Roo.log(" no label && no align");C=E}var F=this;['xs','sm','md','lg'].map(function(G){if(F[G]){C.cls+=' col-'+G+'-'+F[G];}});if(this.disabled){D.disabled=true;}return C;},onResize:function(w,h){Roo.boostrap.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){var x=w-this.trigger.getWidth();this.inputEl().setWidth(this.adjustWidth('input',x));this.trigger.setStyle('left',x+'px');}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.inputEl();},getPositionEl:function(){return this.inputEl();},alignErrorIcon:function(){this.errorIcon.alignTo(this.inputEl(),'tl-tr',[2,0]);},initEvents:function(){Roo.bootstrap.TriggerField.superclass.initEvents.call(this);this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false);}
+Roo.bootstrap.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TriggerField,Roo.bootstrap.Input,{hideTrigger:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',getAutoCreate:function(){var A=this.parent();var B=this.parentLabelAlign();var id=Roo.id();var C={cls:'form-group'};var D={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'off',placeholder:this.placeholder||''};if(this.name){D.name=this.name;}if(this.size){D.cls+=' input-'+this.size;}var E={cls:'combobox-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D,{tag:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'},{tag:'span',cls:'input-group-addon btn dropdown-toggle',cn:[{tag:'span',cls:'caret'},{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}]}]}]};if(B==='left'&&this.fieldLabel.length){Roo.log("left and has label");C.cn=[{tag:'label','for':id,cls:'col-sm-2 control-label',html:this.fieldLabel},{cls:"col-sm-10",cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");C.cn=[{tag:'label',html:this.fieldLabel},E];}else {Roo.log(" no label && no align");C=E}var F=this;['xs','sm','md','lg'].map(function(G){if(F[G]){C.cls+=' col-'+G+'-'+F[G];}});if(this.disabled){D.disabled=true;}return C;},onResize:function(w,h){Roo.boostrap.TriggerField.superclass.onResize.apply(this,arguments);if(typeof w=='number'){var x=w-this.trigger.getWidth();this.inputEl().setWidth(this.adjustWidth('input',x));this.trigger.setStyle('left',x+'px');}},adjustSize:Roo.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.inputEl();},getPositionEl:function(){return this.inputEl();},alignErrorIcon:function(){this.errorIcon.alignTo(this.inputEl(),'tl-tr',[2,0]);},initEvents:function(){Roo.bootstrap.TriggerField.superclass.initEvents.call(this);this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false);}
 this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});},initTrigger:function(){},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();}
 Roo.bootstrap.TriggerField.superclass.onDestroy.call(this);},onFocus:function(){Roo.bootstrap.TriggerField.superclass.onFocus.call(this);},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur();}},onBlur:function(){},mimicBlur:function(e,t){},triggerBlur:function(){this.mimicing=false;Roo.get(Roo.isIE?document.body:document).un("mousedown",this.mimicBlur);if(this.monitorTab){this.el.un("keydown",this.checkTab,this);}
 Roo.bootstrap.TriggerField.superclass.onBlur.call(this);},validateBlur:function(e,t){return true;},onDisable:function(){Roo.bootstrap.TriggerField.superclass.onDisable.call(this);},onEnable:function(){Roo.bootstrap.TriggerField.superclass.onEnable.call(this);},onShow:function(){var ae=this.getActionEl();if(ae){ae.dom.style.display='';ae.dom.style.visibility='visible';}},onHide:function(){var ae=this.getActionEl();ae.dom.style.display='none';},onTriggerClick:Roo.emptyFn});