Roo/bootstrap/Modal.js
[roojs1] / Roo / bootstrap / Modal.js
index f7741b5..b24a8cc 100644 (file)
@@ -272,33 +272,27 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
             
             var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30);
             
+            // for fix height
             if(this.height) {
                 this.setSize(w, this.height);
                 return;
             }
             
-            var view_height = Roo.lib.Dom.getViewportHeight(true) - 60;
-            
             var body_childs = this.bodyEl.dom.childNodes;
-            var body_height = 0;
+            var full_height = this.headerEl.getHeight() + this.footerEl.getHeight();
             for(var i = 0; i < body_childs.length; i++) {
-                body_height += body_childs[i].offsetHeight;
+                
+                if(body_childs[i].classList.indexOf('roo-layout-region') * 1 != -1) {
+                    var layout_childs = body_childs[i].childNodes;
+                    for(var j = 0; j < layout_childs.length; j++) {
+                        
+                    }
+                }
+                
+                full_height += body_childs[i].offsetHeight;
             }
             
-            this.setSize(w, this.height || view_height);
-            
-            
-            
-            // 
-            // if(
-            //     (
-            //         this.headerEl.getHeight() + 
-            //         this.bodyEl.getHeight() + 
-            //         this.footerEl.getHeight()
-            //     ) > view_height) {
-            // } {
-            //     this.setSize(w,view_height);
-            // }
+            // this.setSize(w, Math.min(full_height, Roo.lib.Dom.getViewportHeight(true) - 60));
         }
         
     },