Roo/bootstrap/TriggerField.js
authoredward <edward@roojs.com>
Fri, 15 Jan 2016 07:15:36 +0000 (15:15 +0800)
committeredward <edward@roojs.com>
Fri, 15 Jan 2016 07:15:36 +0000 (15:15 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index aeaa654..48f7492 100644 (file)
@@ -377,7 +377,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
             var close = this.closeTriggerEl();
             
             if(close){
-                close.setVisibilityMode(Roo.Element.DISPALY).hide();
+                close.setVisibilityMode(Roo.Element.DISPLAY).hide();
                 close.on('click', this.removeBtnClick, this, close);
             }
         }
index 54d4b34..85c9107 100644 (file)
@@ -8834,7 +8834,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
             var close = this.closeTriggerEl();
             
             if(close){
-                close.setVisibilityMode(Roo.Element.DISPALY).hide();
+                close.setVisibilityMode(Roo.Element.DISPLAY).hide();
                 close.on('click', this.removeBtnClick, this, close);
             }
         }
@@ -13137,7 +13137,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         if(this.removable && !this.multiple){
             var close = this.closeTriggerEl();
-            
             if(close){
                 close.setVisibilityMode(Roo.Element.DISPLAY).hide();
                 close.on('click', this.removeBtnClick, this, close);
index 500d6ce..cab6693 100644 (file)
@@ -193,7 +193,7 @@ E.cn.push(C);if(this.hasFeedback&&!this.allowBlank){E.cls+=' has-feedback';E.cn.
 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,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,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:'new-password',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.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',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',html:this.after});}};var F={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};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:[D]}]}]}};var G={cls:'select2-container input-group',cn:[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 btn dropdown-toggle',cn:[H,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}]}]})}if(this.multiple){G.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:[G]}];}else if(this.fieldLabel.length){Roo.log(" label");B.cn=[{tag:'label',html:this.fieldLabel},G];}else {Roo.log(" no label && no align");B=G}var I=this;['xs','sm','md','lg'].map(function(J){if(I[J]){B.cls+=' col-'+J+'-'+I[J];}});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});}if(this.removable&&!this.editable&&!this.tickable){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPALY).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();}},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();}
+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();}},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});
 //Roo/data/SortTypes.js