From 6ddb62e5158ccf64b1d7d1b2c5b1859aec49cd3e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 29 Nov 2018 11:59:39 +0800 Subject: [PATCH] Roo/bootstrap/ComboBox.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/ComboBox.js | 4 ++-- roojs-bootstrap-debug.js | 6 ++++-- roojs-bootstrap.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Roo/bootstrap/ComboBox.js b/Roo/bootstrap/ComboBox.js index 796c014dc9..e8d81615c9 100644 --- a/Roo/bootstrap/ComboBox.js +++ b/Roo/bootstrap/ComboBox.js @@ -770,8 +770,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(!this.tpl){ this.tpl = Roo.bootstrap.version == 4 ? - '{' + this.displayField + '}'; - '{' + this.displayField + '}'; + '{' + this.displayField + '}' : // 4 does not need
  • and it get's really confisued. + '
  • {' + this.displayField + '}
  • '; } this.view = new Roo.View(this.list, this.tpl, { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 12e89a60e0..ddb0fb5240 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -10685,7 +10685,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input, { createList : function() { this.list = Roo.get(document.body).createChild({ - tag: 'ul', + tag: Roo.bootstrap.version == 4 ? 'div' : 'ul', cls: 'typeahead typeahead-long dropdown-menu', style: 'display:none' }); @@ -13631,7 +13631,9 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { */ if(!this.tpl){ - this.tpl = '
  • {' + this.displayField + '}
  • '; + this.tpl = Roo.bootstrap.version == 4 ? + '{' + this.displayField + '}' : // 4 does not need
  • and it get's really confisued. + '
  • {' + this.displayField + '}
  • '; } this.view = new Roo.View(this.list, this.tpl, { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 0a85f86eef..bd69163e12 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -435,7 +435,7 @@ var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inpu },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.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:'ul',cls:'typeahead typeahead-long dropdown-menu',style:'display:none'});this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; +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'; ;},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'; @@ -539,7 +539,7 @@ var N=this;['xs','sm','md','lg'].map(function(O){if(N[O]){A.cls+=' col-'+O+'-'+N }this.indicator=this.indicatorEl();this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;while(e){e=e.previousSibling;++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k); }if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();return;}if(this.tickable){this.initTickableEvents();return;}Roo.bootstrap.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first(); this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth); -B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl='
  • {'+this.displayField+'}
  • '; +B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl=Roo.bootstrap.version==4?'{'+this.displayField+'}':'
  • {'+this.displayField+'}
  • '; }this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass});this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this); if(!this.editable){this.editable=true;this.setEditable(false);}this.keyNav=new Roo.KeyNav(this.inputEl(),{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else{this.inKeyMode=true;this.selectNext(); }},"enter":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true;},"esc":function(e){this.collapse();},"tab":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true; -- 2.39.2