* @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 || [];
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)
{