roojs-bootstrap.js
authoredward <edward@roojs.com>
Tue, 9 Jan 2018 05:57:51 +0000 (13:57 +0800)
committeredward <edward@roojs.com>
Tue, 9 Jan 2018 05:57:51 +0000 (13:57 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 651e863..f984348 100644 (file)
@@ -7586,6 +7586,11 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component,  {
      * @cfg {Boolean} errorMask (true|false) default false
      */
     errorMask : false,
+    
+    /**
+     * @cfg {Number} maskOffset Default 100
+     */
+    maskOffset : 100,
 
     getAutoCreate : function(){
 
@@ -8099,13 +8104,13 @@ Roo.apply(Roo.bootstrap.Form, {
             
             var ot = this.target.el.calcOffsetsTo(scrollable);
             
-            var scrollTo = ot[1] - 100;
+            var scrollTo = ot[1] - this.form.maskOffset;
             
             var maxScroll = Roo.lib.Dom.getDocumentHeight() - Roo.lib.Dom.getViewportHeight();
             
             scrollTo = Math.min(scrollTo, maxScroll);
             
-            scrollable.scrollTo('top', scrollTo);
+            scrollable.dom.scrollTop = scrollTo;
             
             var box = this.target.el.getBox();
 
index 8a78a2f..bc7f365 100644 (file)
@@ -303,7 +303,7 @@ this.reader=this.form.reader;};Roo.extend(Roo.form.Action.Load,Roo.form.Action,{
 if(B===true||!B.success||!B.data){this.failureType=Roo.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return;}this.form.clearInvalid();this.form.setValues(B.data);this.form.afterAction(this,true);},handleResponse:function(A){if(this.form.reader){var rs=this.form.reader.read(A);
 var B=rs.records&&rs.records[0]?rs.records[0].data:null;return {success:rs.success,data:B};}return Roo.decode(A.responseText);}});Roo.form.Action.ACTION_TYPES={'load':Roo.form.Action.Load,'submit':Roo.form.Action.Submit};
 // Roo/bootstrap/Form.js
-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,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''}
+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,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;}
@@ -322,7 +322,7 @@ sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd)
 ,true),right:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-right-mask"},true)};this.maskEl.top.enableDisplayMode("block");this.maskEl.left.enableDisplayMode("block");this.maskEl.bottom.enableDisplayMode("block");this.maskEl.right.enableDisplayMode("block");
 this.toolTip=new Roo.bootstrap.Tooltip({cls:'roo-form-error-popover',alignment:{'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['tl-bl',[0,2],'top'],'top':['bl-tl',[0,-2],'bottom']}});this.toolTip.render(Roo.get(document.body));this.toolTip.el.enableDisplayMode("block");
 Roo.get(document.body).on('click',function(){this.unmask();},this);this.isApplied=true},mask:function(A,B){this.form=A;this.target=B;if(!this.form.errorMask||!B.el){return;}var C=this.target.el.findScrollableParent()||this.target.el.findParent('div.modal',100,true)||Roo.get(document.body);
-var ot=this.target.el.calcOffsetsTo(C);var D=ot[1]-100;var E=Roo.lib.Dom.getDocumentHeight()-Roo.lib.Dom.getViewportHeight();D=Math.min(D,E);C.scrollTo('top',D);var F=this.target.el.getBox();var G=Roo.bootstrap.Modal.zIndex++;this.maskEl.top.setStyle('position','fixed');
+var ot=this.target.el.calcOffsetsTo(C);var D=ot[1]-this.form.maskOffset;var E=Roo.lib.Dom.getDocumentHeight()-Roo.lib.Dom.getViewportHeight();D=Math.min(D,E);C.dom.scrollTop=D;var F=this.target.el.getBox();var G=Roo.bootstrap.Modal.zIndex++;this.maskEl.top.setStyle('position','fixed');
 this.maskEl.top.setStyle('z-index',G);this.maskEl.top.setSize(Roo.lib.Dom.getDocumentWidth(),F.y-this.padding);this.maskEl.top.setXY([0,0]);this.maskEl.top.show();this.maskEl.left.setStyle('position','fixed');this.maskEl.left.setStyle('z-index',G);this.maskEl.left.setSize(Roo.lib.Dom.getDocumentWidth()-F.right-this.padding,F.height+this.padding*2);
 this.maskEl.left.setXY([F.right+this.padding,F.y-this.padding]);this.maskEl.left.show();this.maskEl.bottom.setStyle('position','fixed');this.maskEl.bottom.setStyle('z-index',G);this.maskEl.bottom.setSize(Roo.lib.Dom.getDocumentWidth(),Roo.lib.Dom.getDocumentHeight()-F.bottom-this.padding);
 this.maskEl.bottom.setXY([0,F.bottom+this.padding]);this.maskEl.bottom.show();this.maskEl.right.setStyle('position','fixed');this.maskEl.right.setStyle('z-index',G);this.maskEl.right.setSize(F.x-this.padding,F.height+this.padding*2);this.maskEl.right.setXY([0,F.y-this.padding]);