From 4ba63707471ead316c0b4de596e89db58a44addf Mon Sep 17 00:00:00 2001 From: john Date: Tue, 2 Oct 2018 19:16:04 +0800 Subject: [PATCH] sync --- Roo/bootstrap/Modal.js | 27 +++++++++++++++++---------- roojs-bootstrap-debug.js | 27 +++++++++++++++++---------- roojs-bootstrap.js | 25 ++++++++++++------------- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 508c579159..76003a54dc 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -72,8 +72,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { animate : true, fitwindow: false, - - + // private dialogEl: false, bodyEl: false, @@ -85,6 +84,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { max_width: 0, + max_height: 0, + fit_content: false, onRender : function(ct, position) @@ -279,11 +280,16 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); if(this.height) { - this.setSize( - w, - this.height <= Roo.lib.Dom.getViewportHeight(true) - 60 ? - this.height : Roo.lib.Dom.getViewportHeight(true) - 60 - ); + this.setSize(w, this.height); + return; + } + + if(this.max_height) { + this.setSize(w,Math.min( + this.max_height, + Roo.lib.Dom.getViewportHeight(true) - 60 + )); + return; } @@ -476,7 +482,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { for(var i = 0; i < child_nodes.length; i++) { - // for modal with tabs... + /* + * for modal with tabs... if(child_nodes[i].classList.contains('roo-layout-panel')) { var layout_childs = child_nodes[i].childNodes; @@ -491,7 +498,6 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if(layout_body_childs[k].classList.contains('navbar')) { child_height += layout_body_childs[k].offsetHeight; - // Roo.log('nav height: '+ layout_body_childs[k].offsetHeight); continue; } @@ -503,7 +509,6 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if(layout_body_tab_childs[m].classList.contains('roo-layout-active-content')) { child_height += this.getChildHeight(layout_body_tab_childs[m].childNodes); - // Roo.log('active panel height: '+this.getChildHeight(layout_body_tab_childs[m].childNodes)); continue; } @@ -516,8 +521,10 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { } continue; } + */ child_height += child_nodes[i].offsetHeight; + // Roo.log(child_nodes[i].offsetHeight); } return child_height; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 1e47da9980..b73e72fe2f 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2633,8 +2633,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { animate : true, fitwindow: false, - - + // private dialogEl: false, bodyEl: false, @@ -2646,6 +2645,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { max_width: 0, + max_height: 0, + fit_content: false, onRender : function(ct, position) @@ -2840,11 +2841,16 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); if(this.height) { - this.setSize( - w, - this.height <= Roo.lib.Dom.getViewportHeight(true) - 60 ? - this.height : Roo.lib.Dom.getViewportHeight(true) - 60 - ); + this.setSize(w, this.height); + return; + } + + if(this.max_height) { + this.setSize(w,Math.min( + this.max_height, + Roo.lib.Dom.getViewportHeight(true) - 60 + )); + return; } @@ -3037,7 +3043,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { for(var i = 0; i < child_nodes.length; i++) { - // for modal with tabs... + /* + * for modal with tabs... if(child_nodes[i].classList.contains('roo-layout-panel')) { var layout_childs = child_nodes[i].childNodes; @@ -3052,7 +3059,6 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if(layout_body_childs[k].classList.contains('navbar')) { child_height += layout_body_childs[k].offsetHeight; - // Roo.log('nav height: '+ layout_body_childs[k].offsetHeight); continue; } @@ -3064,7 +3070,6 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if(layout_body_tab_childs[m].classList.contains('roo-layout-active-content')) { child_height += this.getChildHeight(layout_body_tab_childs[m].childNodes); - // Roo.log('active panel height: '+this.getChildHeight(layout_body_tab_childs[m].childNodes)); continue; } @@ -3077,8 +3082,10 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { } continue; } + */ child_height += child_nodes[i].offsetHeight; + // Roo.log(child_nodes[i].offsetHeight); } return child_height; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 74f6c1e4fe..4297bdcf5f 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -103,7 +103,7 @@ this.menu=this.addxtype(Roo.apply({},this.menu));}},onClick:function(e){Roo.log( // Roo/bootstrap/MenuSeparator.js Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}}); // Roo/bootstrap/Modal.js -Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,fit_content:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A); +Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,max_height:0,fit_content:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A); if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); }this.dialogEl=this.el.select('.modal-dialog',true).first();this.bodyEl=this.el.select('.modal-body',true).first();this.closeEl=this.el.select('.modal-header .close',true).first();this.headerEl=this.el.select('.modal-header',true).first();this.titleEl=this.el.select('.modal-title',true).first(); this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);if(this.buttons.length){Roo.each(this.buttons,function(bb){var b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button'; @@ -112,18 +112,17 @@ for(var i=0;i