Roo/bootstrap/Modal.js
[roojs1] / Roo / bootstrap / Modal.js
index 5c95b9c..6b0111e 100644 (file)
@@ -17,7 +17,7 @@
  * @cfg {Boolean} allow_close default true
  * @cfg {Boolean} fitwindow default false
  * @cfg {String} size (sm|lg) default empty
- * @cfg {Number} maxWidth set the maxWidth of modal
+ * @cfg {Number} max_width set the max width of modal
  *
  *
  * @constructor
@@ -83,7 +83,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
 
     size: '',
     
-    maxWidth: 0,
+    max_width: 0,
 
 
     onRender : function(ct, position)
@@ -268,10 +268,22 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
             this.setSize(w,h);
         }
         
-        if(!this.fitwindow && this.maxWidth !== 0){
-            var w = Math.min(this.maxWidth, Roo.lib.Dom.getViewportWidth(true) - 30);
-            var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
-            this.setSize(w,h);
+        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.log(this.bodyEl.dom.offsetHeight);
+            var view_height = Roo.lib.Dom.getViewportHeight(true) - 60;
+            // 
+            // if(
+            //     (
+            //         this.headerEl.getHeight() + 
+            //         this.bodyEl.getHeight() + 
+            //         this.footerEl.getHeight()
+            //     ) > view_height) {
+            // } {
+            //     this.setSize(w,view_height);
+            // }
         }
         
     },