projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
roojs-core.js
[roojs1]
/
Roo
/
MessageBox.js
diff --git
a/Roo/MessageBox.js
b/Roo/MessageBox.js
index
017db43
..
5f640f0
100644
(file)
--- a/
Roo/MessageBox.js
+++ b/
Roo/MessageBox.js
@@
-11,6
+11,7
@@
/**
* @class Roo.MessageBox
/**
* @class Roo.MessageBox
+ * @static
* Utility class for generating different styles of message boxes. The alias Roo.Msg can also be used.
* Example usage:
*<pre><code>
* Utility class for generating different styles of message boxes. The alias Roo.Msg can also be used.
* Example usage:
*<pre><code>
@@
-33,7
+34,7
@@
Roo.Msg.show({
animEl: 'elId'
});
</code></pre>
animEl: 'elId'
});
</code></pre>
- * @s
ingleton
+ * @s
tatic
*/
Roo.MessageBox = function(){
var dlg, opt, mask, waitTimer;
*/
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);
dlg.on("hide", handleHide);
mask = dlg.mask;
dlg.addKeyListener(27, handleEsc);
@@
-170,7
+172,9
@@
Roo.MessageBox = function(){
dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
}
msgEl.innerHTML = text || ' ';
dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
}
msgEl.innerHTML = text || ' ';
- var cw = Math.max(msgEl.offsetWidth, msgEl.scrollWidth);
+
+ 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)
var w = Math.max(
Math.min(opt.width || cw , this.maxWidth),
Math.max(opt.minWidth || this.minWidth, bwidth)
@@
-181,18
+185,20
@@
Roo.MessageBox = function(){
if(dlg.isVisible()){
dlg.fixedcenter = false;
}
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 );
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) {
} 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 {
} else {
- bodyEl.dom.style.overflow = '';
+ bodyEl.dom.style.overflow
X
= '';
}
dlg.setContentSize(w, bodyEl.getHeight());
}
dlg.setContentSize(w, bodyEl.getHeight());
@@
-302,7
+308,9
@@
Roo.Msg.show({
if(this.isVisible()){
this.hide();
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";
//this.alert("ERROR", "Multiple dialogs where displayed at the same time");
//throw "Roo.MessageBox ERROR : Multiple dialogs where displayed at the same time";
@@
-357,6
+365,7
@@
Roo.Msg.show({
d.animateTarget = null;
d.show(options.animEl);
}
d.animateTarget = null;
d.show(options.animEl);
}
+ dlg.toFront();
return this;
},
return this;
},