PDA

View Full Version : [FIXED-393][3.0.0] Ext.MessageBox maxWidth bug with fix



Scott Murawski
16 Dec 2009, 9:14 PM
In the Ext.MessageBox code, there's the updateText function. It seems that opts.maxWidth isn't used in the width calculation. The code below is from Ext 3.0.0.



updateText : function(text){
if(!dlg.isVisible() && !opt.width){
dlg.setSize(this.maxWidth, 100); // resize first so content is never clipped from previous shows
}
msgEl.update(text || ' ');

var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0;
var mw = msgEl.getWidth() + msgEl.getMargins('lr');
var fw = dlg.getFrameWidth('lr');
var bw = dlg.body.getFrameWidth('lr');
if (Ext.isIE && iw > 0){
//3 pixels get subtracted in the icon CSS for an IE margin issue,
//so we have to add it back here for the overall width to be consistent
iw += 3;
}
var w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),
Math.max(opt.minWidth || this.minWidth, bwidth || 0));

evant
17 Dec 2009, 5:30 AM
Agreed, thanks for the report.

Fix applied to svn in rev #5792 for patch release 3.1.1.