From cab5de3f889ba5f80beb2f69ba1ea3f0b69faa92 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 26 Sep 2018 11:41:11 +0800 Subject: [PATCH] Roo/bootstrap/Modal.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Modal.js | 6 +++--- roojs-bootstrap-debug.js | 23 ++++++++++++++++++++--- roojs-bootstrap.js | 14 +++++++------- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 55d1099775..a82a70c18d 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -272,13 +272,13 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); + Roo.log(this.height); + if(this.height) { this.setSize(w, this.height); return; } - if() - var view_height = Roo.lib.Dom.getViewportHeight(true) - 60; var body_childs = this.bodyEl.dom.childNodes; @@ -287,7 +287,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { body_height += body_childs[i].offsetHeight; } - this.setSize(w, this.height || view_height); + // this.setSize(w, this.height || view_height); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 3291f529c6..d62a2b20c4 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2830,11 +2830,28 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { } if(!this.fitwindow && this.max_width !== 0){ + var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); - // var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60; - this.setSize(w, this.height || Roo.lib.Dom.getViewportHeight(true) - 60); - Roo.log(this.bodyEl.dom.offsetHeight); + + Roo.log(this.height); + + if(this.height) { + this.setSize(w, this.height); + return; + } + var view_height = Roo.lib.Dom.getViewportHeight(true) - 60; + + var body_childs = this.bodyEl.dom.childNodes; + var body_height = 0; + for(var i = 0; i < body_childs.length; i++) { + body_height += body_childs[i].offsetHeight; + } + + // this.setSize(w, this.height || view_height); + + + // // if( // ( diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index dcdfa17842..d80259a5d1 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -112,13 +112,13 @@ for(var i=0;i