* @cfg {Boolean} allow_close default true
* @cfg {Boolean} fitwindow default false
* @cfg {String} size (sm|lg) default empty
+ * @cfg {Number} max_width set the max width of modal
*
*
* @constructor
closeEl: false,
size: '',
+
+ max_width: 0,
onRender : function(ct, position)
this.setSize(w,h);
}
+ if(!this.fitwindow && this.max_width !== 0){
+
+ var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30);
+
+ 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;
+ for(var i = 0; i < body_childs.length; i++) {
+ body_height += body_childs[i].offsetHeight;
+ }
+
+ if(body_height + this.headerEl.getHeight() + this.footerEl.getHeight() > view_height) {
+ this.setSize(w, this.height || view_height);
+ }
+
+ }
},