Roo/MessageBox.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 22 Dec 2011 05:07:16 +0000 (13:07 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 22 Dec 2011 05:07:16 +0000 (13:07 +0800)
Roo/MessageBox.js

index b0798c0..017db43 100644 (file)
@@ -170,9 +170,9 @@ Roo.MessageBox = function(){
                 dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
             }
             msgEl.innerHTML = text || '&#160;';
-            
+            var cw =  Math.max(msgEl.offsetWidth, msgEl.scrollWidth);
             var w = Math.max(
-                    Math.min(opt.width || Math.max(msgEl.offsetWidth, msgEl.scrollWidth), this.maxWidth), 
+                    Math.min(opt.width || cw , this.maxWidth), 
                     Math.max(opt.minWidth || this.minWidth, bwidth)
             );
             if(opt.prompt){
@@ -189,6 +189,11 @@ Roo.MessageBox = function(){
                 bodyEl.dom.style.height = '';
                 bodyEl.dom.style.overflowY = '';
             }
+            if (cw > w) {
+                bodyEl.dom.style.overflowX = 'auto !important';
+            } else {
+                bodyEl.dom.style.overflow = '';
+            }
             
             dlg.setContentSize(w, bodyEl.getHeight());
             if(dlg.isVisible()){