X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FMessageBox.js;h=5f640f075b12c0db5b0fcaa91c8a0c5039dfa5eb;hb=refs%2Fheads%2Fwip_leon_T7094_logo_image_upload_in_boilerplate;hp=45245916180c129bf11a097ccc1efbd4e32f59f5;hpb=248336d1d6b1c2ed60cd9153863b4644d78689e8;p=roojs1 diff --git a/Roo/MessageBox.js b/Roo/MessageBox.js index 4524591618..5f640f075b 100644 --- a/Roo/MessageBox.js +++ b/Roo/MessageBox.js @@ -11,6 +11,7 @@ /** * @class Roo.MessageBox + * @static * Utility class for generating different styles of message boxes. The alias Roo.Msg can also be used. * Example usage: *
@@ -33,7 +34,7 @@ Roo.Msg.show({
animEl: 'elId'
});
- * @singleton
+ * @static
*/
Roo.MessageBox = function(){
var dlg, opt, mask, waitTimer;
@@ -120,6 +121,7 @@ Roo.MessageBox = function(){
}
}
});
+
dlg.on("hide", handleHide);
mask = dlg.mask;
dlg.addKeyListener(27, handleEsc);
@@ -170,15 +172,9 @@ Roo.MessageBox = function(){
dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
}
msgEl.innerHTML = text || ' ';
- this.updateTextSize.defer(100, this);
- return this;
- },
-
- updateTextSize: function()
- {
-
- var cw = Math.max(msgEl.offsetWidth, bodyEl.scrollWidth);
- Roo.log("guesed size: " + cw);
+
+ var cw = Math.max(msgEl.offsetWidth, msgEl.parentNode.scrollWidth);
+ //Roo.log("guesed size: " + JSON.stringify([cw,msgEl.offsetWidth, msgEl.parentNode.scrollWidth]));
var w = Math.max(
Math.min(opt.width || cw , this.maxWidth),
Math.max(opt.minWidth || this.minWidth, bwidth)
@@ -189,16 +185,18 @@ Roo.MessageBox = function(){
if(dlg.isVisible()){
dlg.fixedcenter = false;
}
- // to big, make it scoll.
+ // to big, make it scroll. = But as usual stupid IE does not support
+ // !important..
+
if ( bodyEl.getHeight() > (Roo.lib.Dom.getViewHeight() - 100)) {
bodyEl.setHeight ( Roo.lib.Dom.getViewHeight() - 100 );
- bodyEl.dom.style.overflowY = 'auto !important';
+ bodyEl.dom.style.overflowY = 'auto' + ( Roo.isIE ? '' : ' !important');
} else {
bodyEl.dom.style.height = '';
bodyEl.dom.style.overflowY = '';
}
if (cw > w) {
- bodyEl.dom.style.overflowX = 'auto !important';
+ bodyEl.dom.style.get = 'auto' + ( Roo.isIE ? '' : ' !important');
} else {
bodyEl.dom.style.overflowX = '';
}
@@ -310,7 +308,9 @@ Roo.Msg.show({
if(this.isVisible()){
this.hide();
- Roo.log("Old Dialog Message:" + msgEl.innerHTML )
+ Roo.log("[Roo.Messagebox] Show called while message displayed:" );
+ Roo.log("Old Dialog Message:" + msgEl.innerHTML );
+ Roo.log("New Dialog Message:" + options.msg )
//this.alert("ERROR", "Multiple dialogs where displayed at the same time");
//throw "Roo.MessageBox ERROR : Multiple dialogs where displayed at the same time";
@@ -365,6 +365,7 @@ Roo.Msg.show({
d.animateTarget = null;
d.show(options.animEl);
}
+ dlg.toFront();
return this;
},