From debeedba65a3b0548fffa79b21238ad173737a3b Mon Sep 17 00:00:00 2001 From: john Date: Fri, 7 Dec 2018 13:21:33 +0800 Subject: [PATCH] sync --- Roo/bootstrap/Modal.js | 19 +++++++++---------- roojs-bootstrap-debug.js | 22 ++++++++++++---------- roojs-bootstrap.js | 12 ++++++------ 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 73b5cf3039..d3d2608866 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -287,9 +287,12 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { ); if (this.fitwindow) { + + var view_height = Roo.lib.Dom.getViewportHeight(true); + this.setSize( this.width || Roo.lib.Dom.getViewportWidth(true) - 30, - this.height || Roo.lib.Dom.getViewportHeight(true) - 60 + this.height || Roo.lib.Dom.getViewportHeight(true) // catering margin-top 30 margin-bottom 30 ); return; } @@ -452,22 +455,18 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { { //this.el.select('.modal-footer').() }, - diff : false, resizeTo: function(w,h) { - // skip.. ?? why?? - this.dialogEl.setWidth(w); - if (this.diff === false) { - this.diff = this.dialogEl.getHeight() - this.bodyEl.getHeight(); - } - - this.bodyEl.setHeight(h - this.diff); + + var diff = this.headerEl.getHeight() + this.footerEl.getHeight() + 30; // dialog margin-bottom: 30 + this.bodyEl.setHeight(h - diff); + this.fireEvent('resize', this); - }, + setContentSize : function(w, h) { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 88785e9538..3d4f568459 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2917,9 +2917,15 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { ); if (this.fitwindow) { + + var view_height = Roo.lib.Dom.getViewportHeight(true); + + Roo.log("dialog height: "+this.height); + Roo.log("view height:" + view_height); + this.setSize( this.width || Roo.lib.Dom.getViewportWidth(true) - 30, - this.height || Roo.lib.Dom.getViewportHeight(true) - 60 + this.height || Roo.lib.Dom.getViewportHeight(true) // catering margin-top 30 margin-bottom 30 ); return; } @@ -3082,22 +3088,18 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { { //this.el.select('.modal-footer').() }, - diff : false, resizeTo: function(w,h) { - // skip.. ?? why?? - this.dialogEl.setWidth(w); - if (this.diff === false) { - this.diff = this.dialogEl.getHeight() - this.bodyEl.getHeight(); - } - - this.bodyEl.setHeight(h - this.diff); + + var diff = this.headerEl.getHeight() + this.footerEl.getHeight() + 30; // dialog margin-bottom: 30 + this.bodyEl.setHeight(h - diff); + this.fireEvent('resize', this); - }, + setContentSize : function(w, h) { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index f70eb59622..0b57d30bf3 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -117,17 +117,17 @@ i