Roo/bootstrap/TriggerField.js
authorEdward <edward@roojs.com>
Tue, 27 May 2014 04:53:13 +0000 (12:53 +0800)
committerEdward <edward@roojs.com>
Tue, 27 May 2014 04:53:13 +0000 (12:53 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/TriggerField.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 724bd1d..1efa7ad 100644 (file)
@@ -203,7 +203,8 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         
         if (align ==='left' && this.fieldLabel.length) {
                 
-            
+                Roo.log('labelWidth');
+                Roo.log(this.labelWidth);
             
                 Roo.log("left and has label");
                 cfg.cn = [
index 1982845..82e9478 100644 (file)
@@ -5399,7 +5399,8 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         
         if (align ==='left' && this.fieldLabel.length) {
                 
-            
+                Roo.log('labelWidth');
+                Roo.log(this.labelWidth);
             
                 Roo.log("left and has label");
                 cfg.cn = [
index 71ac486..1fe77fe 100644 (file)
@@ -118,7 +118,7 @@ Roo.bootstrap.TextArea=function(A){Roo.bootstrap.TextArea.superclass.constructor
 E.cn.push(C);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}if(A==='left'&&this.fieldLabel.length){Roo.log("left and has label");B.cn=[{tag:'label','for':id,cls:'control-label col-sm-'+this.labelWidth,html:this.fieldLabel},{cls:"col-sm-"+(12-this.labelWidth),cn:[E]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label',html:this.fieldLabel},E];}else {Roo.log(" no label && no align");B.cn=[E];}if(this.disabled){C.disabled=true;}return B;},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=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;}if(this.disabled){D.disabled=true;}var E=D;if(this.before||this.after){E={cls:'input-group',cn:[]};if(this.before){E.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
-E.cn.push(D);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};var F={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},E]};if(this.multiple){Roo.log('multiple');F={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'select2-choices',cn:[{tag:'li',cls:'select2-search-field',cn:[E]}]}]}};var G={cls:'select2-container input-group',cn:[F,{tag:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'}]};if(!this.multiple){G.cn.push({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(this.multiple){G.cls+=' select2-container-multi';}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:[G]}];}else if(this.fieldLabel.length){Roo.log(" label");C.cn=[{tag:'label',html:this.fieldLabel},G];}else {Roo.log(" no label && no align");C=G}var H=this;['xs','sm','md','lg'].map(function(I){if(H[I]){C.cls+=' col-'+I+'-'+H[I];}});return C;},onResize:function(w,h){},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);if(!this.multiple){this.trigger=this.el.select('span.dropdown-toggle',true).first();if(this.hideTrigger){this.trigger.setDisplayed(false);}
+E.cn.push(D);if(this.after){E.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};var F={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},E]};if(this.multiple){Roo.log('multiple');F={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'select2-choices',cn:[{tag:'li',cls:'select2-search-field',cn:[E]}]}]}};var G={cls:'select2-container input-group',cn:[F,{tag:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'}]};if(!this.multiple){G.cn.push({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(this.multiple){G.cls+=' select2-container-multi';}if(B==='left'&&this.fieldLabel.length){Roo.log('labelWidth');Roo.log(this.labelWidth);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:[G]}];}else if(this.fieldLabel.length){Roo.log(" label");C.cn=[{tag:'label',html:this.fieldLabel},G];}else {Roo.log(" no label && no align");C=G}var H=this;['xs','sm','md','lg'].map(function(I){if(H[I]){C.cls+=' col-'+I+'-'+H[I];}});return C;},onResize:function(w,h){},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);if(!this.multiple){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});}if(this.multiple){this.inputEl().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});