Roo/bootstrap/Modal.js
[roojs1] / Roo / bootstrap / Modal.js
index f72a6e3..f9020a0 100644 (file)
@@ -84,7 +84,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
     size: '',
     
     max_width: 0,
-
+    
+    fit_content: false,
 
     onRender : function(ct, position)
     {
@@ -278,20 +279,18 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
                 return;
             }
             
+            if(!this.fit_content) {
+                this.setSize(w, Roo.lib.Dom.getViewportHeight(true) - 60);
+                return;
+            }
+            
             var body_childs = this.bodyEl.dom.childNodes;
             var full_height = this.headerEl.getHeight() + this.footerEl.getHeight();
             for(var i = 0; i < body_childs.length; i++) {
-                
-                if(body_childs[i].classList.indexOf('roo-layout-region') * 1 != -1) {
-                    
-                    var layout_childs = body_childs[i].childNodes;
-                    
-                }
-                
                 full_height += body_childs[i].offsetHeight;
             }
             
-            // this.setSize(w, Math.min(full_height, Roo.lib.Dom.getViewportHeight(true) - 60));
+            this.setSize(w, Math.min(full_height, Roo.lib.Dom.getViewportHeight(true) - 60));
         }
         
     },