From: john Date: Fri, 7 Dec 2018 05:21:37 +0000 (+0800) Subject: Merge branch 'master' of http://git.roojs.com/roojs1 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=d7fbd89557759c0d551e98cc0b9c4e8b3e4f524d;hp=81e568e0d3480673767574e7b7b7ba2f9ba7c412;p=roojs1 Merge branch 'master' of git.roojs.com/roojs1 --- diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 8e426a9ec2..ab945dd052 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -299,9 +299,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; } @@ -464,22 +467,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