roojs-bootstrap.js
authorMichael <michael@roojs.com>
Thu, 12 Feb 2015 06:14:27 +0000 (14:14 +0800)
committerMichael <michael@roojs.com>
Thu, 12 Feb 2015 06:14:27 +0000 (14:14 +0800)
roojs-bootstrap-debug.js

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

index 2c9201b..db7c7bb 100644 (file)
@@ -7922,7 +7922,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         
         Roo.bootstrap.TriggerField.superclass.initEvents.call(this);
         //this.wrap = this.el.wrap({cls: "x-form-field-wrap"});
-        if(!this.multiple){
+        if(!this.multiple && this.showToggleBtn){
             this.trigger = this.el.select('span.dropdown-toggle',true).first();
             if(this.hideTrigger){
                 this.trigger.setDisplayed(false);
index b03da42..98491ad 100644 (file)
@@ -165,7 +165,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.labelAlign||this.parentLabelAlign();var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'off',placeholder:this.placeholder||''};if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}if(this.disabled){C.disabled=true;}var D=C;if(this.before||this.after){D={cls:'input-group',cn:[]};if(this.before){D.cn.push({tag:'span',cls:'input-group-addon',html:this.before});}
-D.cn.push(C);if(this.after){D.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};var E={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(this.multiple){Roo.log('multiple');E={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'select2-choices',cn:[{tag:'li',cls:'select2-search-field',cn:[D]}]}]}};var F={cls:'select2-container input-group',cn:[E]};if(!this.multiple&&this.showToggleBtn){F.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){F.cls+=' select2-container-multi';}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:[F]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label',html:this.fieldLabel},F];}else {Roo.log(" no label && no align");B=F}var G=this;['xs','sm','md','lg'].map(function(H){if(G[H]){B.cls+=' col-'+H+'-'+G[H];}});return B;},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(){this.createList();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);}
+D.cn.push(C);if(this.after){D.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}};var E={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(this.multiple){Roo.log('multiple');E={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'select2-choices',cn:[{tag:'li',cls:'select2-search-field',cn:[D]}]}]}};var F={cls:'select2-container input-group',cn:[E]};if(!this.multiple&&this.showToggleBtn){F.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){F.cls+=' select2-container-multi';}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:[F]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label',html:this.fieldLabel},F];}else {Roo.log(" no label && no align");B=F}var G=this;['xs','sm','md','lg'].map(function(H){if(G[H]){B.cls+=' col-'+H+'-'+G[H];}});return B;},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(){this.createList();Roo.bootstrap.TriggerField.superclass.initEvents.call(this);if(!this.multiple&&this.showToggleBtn){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});}},createList:function(){this.list=Roo.get(document.body).createChild({tag:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'});this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';;},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(){this.inputEl().dom.disabled=true;},onEnable:function(){this.inputEl().dom.disabled=false;},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});