Roo/bootstrap/Modal.js
[roojs1] / roojs-bootstrap-debug.js
index 4db33e6..dc41071 100644 (file)
@@ -2830,10 +2830,25 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         }
         
         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,h);
+            // var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
+            this.setSize(w,this.height);
+            
+            var view_height = Roo.lib.Dom.getViewportHeight(true) - 60;
+            var modal_height = this.headerEl.getHeight() + this.bodyEl.getHeight() + this.footerEl.getHeight();
+            
+            Roo.log(view_height);
+            Roo.log(modal_height);
+            
+            if(
+                (
+                    this.headerEl.getHeight() + 
+                    this.bodyEl.getHeight() + 
+                    this.footerEl.getHeight()
+                ) > view_height) {
+            } {
+                this.setSize(w,view_height);
+            }
         }
         
     },
@@ -18561,7 +18576,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         this.showMode();
         
         if(this.isInline) {
-            this.show();
+            this.showPopup();
         }
     },
     
@@ -18844,7 +18859,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
     onFocus : function()
     {
         Roo.bootstrap.DateField.superclass.onFocus.call(this);
-        this.show();
+        this.showPopup();
     },
     
     onBlur : function()
@@ -18855,7 +18870,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         
         this.setValue(d);
                 
-        this.hide();
+        this.hidePopup();
     },
     
     showPopup : function()
@@ -18924,7 +18939,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
     {
         if (!this.picker().isVisible()){
             if (e.keyCode == 27) { // allow escape to hide and re-show picker
-                this.show();
+                this.showPopup();
             }
             return;
         }
@@ -18935,7 +18950,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         
         switch(e.keyCode){
             case 27: // escape
-                this.hide();
+                this.hidePopup();
                 e.preventDefault();
                 break;
             case 37: // left
@@ -18995,12 +19010,12 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
                 break;
             case 13: // enter
                 this.setValue(this.formatDate(this.date));
-                this.hide();
+                this.hidePopup();
                 e.preventDefault();
                 break;
             case 9: // tab
                 this.setValue(this.formatDate(this.date));
-                this.hide();
+                this.hidePopup();
                 break;
             case 16: // shift
             case 17: // ctrl
@@ -19055,7 +19070,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
 //                        this.fill()
                         this.setValue(this.formatDate(this.date));
                         
-                        this.hide();
+                        this.hidePopup();
                         break;
                 }
                 break;
@@ -19072,7 +19087,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
                     
                     if(this.singleMode){
                         this.setValue(this.formatDate(this.viewDate));
-                        this.hide();
+                        this.hidePopup();
                         return;
                     }
                     
@@ -19109,7 +19124,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
 //                    this.fill();
                     //Roo.log(this.formatDate(this.date));
                     this.setValue(this.formatDate(this.date));
-                    this.hide();
+                    this.hidePopup();
                 }
                 break;
         }
@@ -26211,6 +26226,7 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
                 placement = 'top';
             }
             
+            align = this.alignment[placement];
         }
         
         this.el.alignTo(this.bindEl, align[0],align[1]);