From 4938c0ee827ad68e05fac973277676020bc41b52 Mon Sep 17 00:00:00 2001 From: john Date: Tue, 2 Oct 2018 13:14:28 +0800 Subject: [PATCH] sync --- Roo/bootstrap/Modal.js | 24 ++++++++++-------------- roojs-bootstrap-debug.js | 24 ++++++++++-------------- roojs-bootstrap.js | 23 +++++++++++------------ 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 9a526faee4..c86b429b15 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -278,19 +278,12 @@ 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.height <= Roo.lib.Dom.getViewportHeight(true) - 60 - ) { - this.setSize(w, this.height); - return; - } - - if( - this.height && - this.height > Roo.lib.Dom.getViewportHeight(true) - 60 - ) { - this.setSize(w, Roo.lib.Dom.getViewportHeight(true) - 60); + if(this.height) { + this.setSize( + w, + this.height <= Roo.lib.Dom.getViewportHeight(true) - 60 ? + this.height : Roo.lib.Dom.getViewportHeight(true) - 60 + ); return; } @@ -316,6 +309,9 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if (!w && !h) { return; } + + Roo.log(h); + this.resizeTo(w,h); }, @@ -429,7 +425,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { this.diff = this.dialogEl.getHeight() - this.bodyEl.getHeight(); } - this.bodyEl.setHeight(h-this.diff); + this.bodyEl.setHeight(h - this.diff); this.fireEvent('resize', this); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 70aaa9c661..f19a0515c9 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2839,19 +2839,12 @@ 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.height <= Roo.lib.Dom.getViewportHeight(true) - 60 - ) { - this.setSize(w, this.height); - return; - } - - if( - this.height && - this.height > Roo.lib.Dom.getViewportHeight(true) - 60 - ) { - this.setSize(w, Roo.lib.Dom.getViewportHeight(true) - 60); + if(this.height) { + this.setSize( + w, + this.height <= Roo.lib.Dom.getViewportHeight(true) - 60 ? + this.height : Roo.lib.Dom.getViewportHeight(true) - 60 + ); return; } @@ -2877,6 +2870,9 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if (!w && !h) { return; } + + Roo.log(h); + this.resizeTo(w,h); }, @@ -2990,7 +2986,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { this.diff = this.dialogEl.getHeight() - this.bodyEl.getHeight(); } - this.bodyEl.setHeight(h-this.diff); + this.bodyEl.setHeight(h - this.diff); this.fireEvent('resize', this); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 8c2b7c07d8..190346508f 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -112,18 +112,17 @@ for(var i=0;iRoo.lib.Dom.getViewportHeight(true)-60){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60); -return;}if(!this.fit_content){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60);return;}var A=this.bodyEl.dom.childNodes;var B=60+this.headerEl.getHeight()+this.footerEl.getHeight();for(var i=0;i