From: edward Date: Mon, 23 Apr 2018 10:17:30 +0000 (+0800) Subject: Roo/bootstrap/MoneyField.js X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=37b1364603a4fade8657b3f99b12f96dc1c2c1cb;p=roojs1 Roo/bootstrap/MoneyField.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/Roo/bootstrap/MoneyField.js b/Roo/bootstrap/MoneyField.js index 37a0f31392..9295a9b91c 100644 --- a/Roo/bootstrap/MoneyField.js +++ b/Roo/bootstrap/MoneyField.js @@ -220,7 +220,7 @@ Roo.extend(Roo.bootstrap.MoneyField, Roo.bootstrap.ComboBox, { this.collapse(); return; } - + Roo.log('run on trigger click'); if(this.triggerAction == 'all') { this.doQuery(this.allQuery, true); return; @@ -229,63 +229,6 @@ Roo.extend(Roo.bootstrap.MoneyField, Roo.bootstrap.ComboBox, { this.doQuery(this.getRawValue()); }, - collapse : function() - { - if(!this.isExpanded()){ - return; - } - - this.list.hide(); - - Roo.get(document).un('mousedown', this.collapseIf, this); - Roo.get(document).un('mousewheel', this.collapseIf, this); - - if (!this.editable) { - Roo.get(document).un('keydown', this.listKeyPress, this); - } - - this.fireEvent('collapse', this); - - this.validate(); - }, - - collapseIf : function(e) - { - var in_combo = e.within(this.el); - var in_list = e.within(this.list); - var is_list = (Roo.get(e.getTarget()).id == this.list.id) ? true : false; - - if (in_combo || in_list || is_list) { - return; - } - - this.collapse(); - }, - - expand : function() - { - if(this.isExpanded()){ - return; - } - - var lw = this.listWidth || Math.max(this.inputEl().getWidth(), this.minListWidth); - - this.list.setWidth(lw); - - this.list.show(); - - this.restrictHeight(); - - Roo.get(document).on('mousedown', this.collapseIf, this); - Roo.get(document).on('mousewheel', this.collapseIf, this); - - if (!this.editable) { - Roo.get(document).on('keydown', this.listKeyPress, this); - } - - this.fireEvent('expand', this); - }, - restrictHeight : function() { this.list.alignTo(this.currencyEl, this.listAlign); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 2aad3f958b..e89614ed7b 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -39985,7 +39985,7 @@ Roo.extend(Roo.bootstrap.MoneyField, Roo.bootstrap.ComboBox, { this.collapse(); return; } - + Roo.log('run on trigger click'); if(this.triggerAction == 'all') { this.doQuery(this.allQuery, true); return; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index a8b922e467..1a45db3ecc 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1642,4 +1642,5 @@ if(this.indicatorpos=='right'){I.cls='roo-required-indicator text-danger fa fa-l }if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;H.cls+=' col-xs-'+(12-this.labelxs);}}}B.cn=[J,H];var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){B.cls+=' col-'+M+'-'+L[M];}});return B;},initEvents:function(){if(!this.store){throw "can not find store for combo"; }this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;this.createList();this.indicator=this.indicatorEl();this.triggerEl=this.el.select('.input-group-addon',true).first();this.triggerEl.on("click",this.onTriggerClick,this,{preventDefault:true} );this.currencyEl=this.el.select('.roo-money-currency-input',true).first();this.amountEl=this.el.select('.roo-money-amount-input',true).first();},onTriggerClick:function(e){if(this.disabled){return;}this.page=0;this.loadNext=false;if(this.isExpanded()){this.collapse(); -return;}if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);return;}this.doQuery(this.getRawValue());},restrictHeight:function(){this.list.alignTo(this.currencyEl,this.listAlign);this.list.alignTo(this.currencyEl,this.listAlign);}}); +return;}Roo.log('run on trigger click');if(this.triggerAction=='all'){this.doQuery(this.allQuery,true);return;}this.doQuery(this.getRawValue());},restrictHeight:function(){this.list.alignTo(this.currencyEl,this.listAlign);this.list.alignTo(this.currencyEl,this.listAlign); +}});