From: john Date: Tue, 2 Oct 2018 11:16:08 +0000 (+0800) Subject: Merge branch 'master' of http://git.roojs.com/roojs1 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=f18038445e8ef460a301b3203c15eb4433966db4;hp=4dd3a02c162ab952684f52555e82c0d3a3937d41;p=roojs1 Merge branch 'master' of git.roojs.com/roojs1 --- 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 159ef5c3a0..3c697b811e 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2625,8 +2625,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { animate : true, fitwindow: false, - - + // private dialogEl: false, bodyEl: false, @@ -2638,6 +2637,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { max_width: 0, + max_height: 0, + fit_content: false, onRender : function(ct, position) @@ -2832,11 +2833,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; } @@ -3029,7 +3035,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; @@ -3044,7 +3051,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; } @@ -3056,7 +3062,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; } @@ -3069,8 +3074,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 f8cf688218..4243200d55 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