Merge branch 'master' of http://git.roojs.com/roojs1
authorjohn <john@roojs.com>
Fri, 7 Dec 2018 05:21:37 +0000 (13:21 +0800)
committerjohn <john@roojs.com>
Fri, 7 Dec 2018 05:21:37 +0000 (13:21 +0800)
1  2 
Roo/bootstrap/Modal.js

diff --combined Roo/bootstrap/Modal.js
@@@ -41,7 -41,14 +41,14 @@@ Roo.bootstrap.Modal = function(config)
           * @param {Roo.bootstrap.Modal} this
           * @param {Roo.EventObject} e
           */
-         "resize" : true
+         "resize" : true,
+          /**
+          * @event close
+          * Fire when the top 'x' close button is pressed.
+          * @param {Roo.bootstrap.Modal} this
+          * @param {Roo.EventObject} e
+          */
+         "close" : true
      });
      this.buttons = this.buttons || [];
  
@@@ -272,11 -279,16 +279,16 @@@ Roo.extend(Roo.bootstrap.Modal, Roo.boo
      initEvents : function()
      {
          if (this.allow_close) {
-             this.closeEl.on('click', this.hide, this);
+             this.closeEl.on('click', this.onClosePress, this);
          }
          Roo.EventManager.onWindowResize(this.resize, this, true);
  
  
+     },
+     
+     onClosePress : function()
+     {
+         
      },
  
      resize : function()
          );
          
          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;
          }
      {
          //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)
      {