Ext3.x
Ext.MessageBox.alert 在chrome与firefox显示的宽度不一致问题
究其原因是因为msgEl.getWidth()得到的值不一致导致的
修正宽度应方法:
chrome:
rect = dom.getBoundingClientRect();
Math.ceil(rect.right - rect.left)
firefox:
dom.offsetWidth;
updateText : function(text) {
if (!dlg.isVisible() && !opt.width) {
dlg.setSize(this.maxWidth, 100);
}
msgEl.update(text ? text + ' ' : ' ');
var iw = iconCls != '' ? (iconEl.getWidth() + iconEl
.getMargins('lr')) : 0, mw = msgEl.getWidth()
+ msgEl.getMargins('lr'), fw = dlg.getFrameWidth('lr'), bw = dlg.body
.getFrameWidth('lr'), w;
// @fixed chrome width
if (Ext.isChrome) {
rect = msgEl.dom.getBoundingClientRect();
mw = Math.ceil(rect.right - rect.left);
}
w = Math.max(Math.min(opt.width || iw + mw + fw + bw, opt.maxWidth
|| this.maxWidth), Math.max(opt.minWidth || this.minWidth,
bwidth || 0));
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)