From c7941b1343fe5f07e5b7095eda72fb16dbaf1eb7 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 27 Sep 2018 12:45:37 +0800 Subject: [PATCH] sync --- Roo/bootstrap/Form.js | 2 ++ Roo/bootstrap/Modal.js | 3 ++- roojs-bootstrap-debug.js | 2 ++ roojs-bootstrap.js | 27 ++++++++++++++------------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Roo/bootstrap/Form.js b/Roo/bootstrap/Form.js index 411fd997cc..f09af63e4e 100644 --- a/Roo/bootstrap/Form.js +++ b/Roo/bootstrap/Form.js @@ -178,6 +178,8 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, { return; } + Roo.log('invalid field: ' + f.name); + valid = false; if(!target && f.el.isVisible(true)){ diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index d3ca8e7349..4683764bc5 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -272,13 +272,14 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); + // for fix height if(this.height) { this.setSize(w, this.height); return; } var body_childs = this.bodyEl.dom.childNodes; - var full_height = this.headerEl.getHeight() + this.footerEl.getHeight() + 60; + var full_height = this.headerEl.getHeight() + this.footerEl.getHeight(); for(var i = 0; i < body_childs.length; i++) { full_height += body_childs[i].offsetHeight; } diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 410ce339b8..c838d61b6c 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -7835,6 +7835,8 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, { return; } + Roo.log('invalid field: ' + f.name); + valid = false; if(!target && f.el.isVisible(true)){ diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 9e5f36a472..c5d0b34820 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -315,19 +315,20 @@ var B=rs.records&&rs.records[0]?rs.records[0].data:null;return {success:rs.succe Roo.bootstrap.Form=function(A){Roo.bootstrap.Form.superclass.constructor.call(this,A);Roo.bootstrap.Form.popover.apply();this.addEvents({clientvalidation:true,beforeaction:true,actionfailed:true,actioncomplete:true});};Roo.extend(Roo.bootstrap.Form,Roo.bootstrap.Component,{method:'POST',timeout:30,align:'left',activeAction:null,waitMsgTarget:false,loadMask:true,errorMask:false,maskOffset:100,maskBody:false,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''} ;if(this.parent().xtype.match(/^Nav/)){A.cls='navbar-form navbar-'+this.align;}if(this.labelAlign=='left'){A.cls+=' form-horizontal';}return A;},initEvents:function(){this.el.on('submit',this.onSubmit,this);this.el.on('keypress',function(e){if(e.getCharCode()!=13){return true; }if(e.getTarget().nodeName.toLowerCase()==='textarea'){return true;}Roo.log("keypress blocked");e.preventDefault();return false;});},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=this.getItems();var B=true;var C=false;A.each(function(f){if(f.validate()){return; -}B=false;if(!C&&f.el.isVisible(true)){C=f;}});if(this.errorMask&&!B){Roo.bootstrap.Form.popover.mask(this,C);}return B;},isDirty:function(){var A=false;var B=this.getItems();B.each(function(f){if(f.isDirty()){A=true;return false;}return true;});return A;} -,doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},beforeAction:function(A){var o=A.options;if(this.loadMask){if(this.maskBody){Roo.get(document.body).mask(o.waitMsg||"Sending",'x-mask-loading')} -else{this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(this.loadMask){if(this.maskBody){Roo.get(document.body).unmask();}else{this.el.unmask();}}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]); -this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;Roo.log("not supported yet");return;}Roo.callback(o.failure,o.scope,[this,A]); -if(!this.hasListener('actionfailed')){Roo.log("need to add dialog support");}this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.getItems();var B=A.get(id);if(!B){A.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){B=f; -return false;}return true;});}return B||null;},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;i