From: Alan Knowles Date: Thu, 24 Jan 2019 08:41:10 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=68957cd0c6876ade42179a1785f1650916087767 roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 49927bdd09..1c70ea2e71 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -10656,7 +10656,8 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input, { combobox.cn.push({ tag :'span', - cls : 'input-group-addon input-group-append input-group-text btn dropdown-toggle', + cls : 'input-group-addon input-group-append input-group-text btn' + + (Roo.bootstrap.version == 3 ? ' dropdown-toggle' : ''), cn : [ caret, { @@ -10862,7 +10863,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 && this.showToggleBtn){ - this.trigger = this.el.select('span.dropdown-toggle',true).first(); + this.trigger = this.el.select('span.input-group-append',true).first(); if(this.hideTrigger){ this.trigger.setDisplayed(false); } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 34cdc337f1..a3a75f884d 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -438,14 +438,14 @@ var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inpu }var D=C;if(this.hasFeedback&&!this.allowBlank){var E={tag:'span',cls:'glyphicon form-control-feedback'};if(this.removable&&!this.editable&&!this.tickable){D={cls:'has-feedback',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'},E]};}else{D={cls:'has-feedback',cn:[D,E]} ;}}else{if(this.removable&&!this.editable&&!this.tickable){D={cls:'roo-removable',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'}]};}}if(this.before||this.after){D={cls:'input-group',cn:[]};if(this.before){D.cn.push({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before} );}D.cn.push(C);if(this.hasFeedback&&!this.allowBlank){D.cls+=' has-feedback';D.cn.push(E);}if(this.after){D.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}};var F=D;if(this.multiple){F={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[D]} -]};}var G={cls:'roo-select2-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},F]};if(!this.multiple&&this.showToggleBtn){var H={tag:'span',cls:'caret'};if(this.caret!=false){H={tag:'i',cls:'fa fa-'+this.caret};}G.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[H,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} +]};}var G={cls:'roo-select2-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},F]};if(!this.multiple&&this.showToggleBtn){var H={tag:'span',cls:'caret'};if(this.caret!=false){H={tag:'i',cls:'fa fa-'+this.caret};}G.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn'+(Roo.bootstrap.version==3?' dropdown-toggle':''),cn:[H,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} ]}]})}if(this.multiple){G.cls+=' roo-select2-container-multi';}var I={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(Roo.bootstrap.version==4){I={tag:'i',style:'display:none'} ;}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');B.cn=[I,{tag:'label','for':id,cls:'control-label',html:this.fieldLabel},{cls:"",cn:[G]}];var J=B.cn[1];var K=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label',cn:[{tag:'span',html:this.fieldLabel} ,I]},{cls:"",cn:[G]}];J=B.cn[0];K=B.cn[1];}if(this.labelWidth>12){J.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){J.cls+=' col-lg-'+this.labellg;K.cls+=' col-lg-'+(12-this.labellg); }if(this.labelmd>0){J.cls+=' col-md-'+this.labelmd;K.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){J.cls+=' col-sm-'+this.labelsm;K.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;K.cls+=' col-xs-'+(12-this.labelxs); }}else if(this.fieldLabel.length){B.cn=[I,{tag:'label',html:this.fieldLabel},G];if(this.indicatorpos=='right'){B.cn=[{tag:'label',cn:[{tag:'span',html:this.fieldLabel},I]},G];}}else{B=G}var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){B.cls+=' col-'+M+'-'+L[M]; }});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); +},initEvents:function(){this.createList();Roo.bootstrap.TriggerField.superclass.initEvents.call(this);if(!this.multiple&&this.showToggleBtn){this.trigger=this.el.select('span.input-group-append',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});}if(this.removable&&!this.editable&&!this.tickable){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide(); A.on('click',this.removeBtnClick,this,A);}}},closeTriggerEl:function(){var A=this.el.select('.roo-combo-removable-btn',true).first();return A?A:false;},removeBtnClick:function(e,h,el){e.preventDefault();if(this.fireEvent("remove",this)!==false){this.reset(); this.fireEvent("afterremove",this)}},createList:function(){this.list=Roo.get(document.body).createChild({tag:Roo.bootstrap.version==4?'div':'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'});this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';