-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathshowDialog.js
More file actions
42 lines (39 loc) · 1.62 KB
/
Copy pathshowDialog.js
File metadata and controls
42 lines (39 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function showDialog(dialog, document) {
if (dialog.style.display == "none") {
if (typeof (document) == "undefined" || document == null) {
document = window.document;
}
var overlayId = "$_dialog_overlay";
var overlay = document.getElementById(overlayId);
if (typeof (overlay) == "undefined" || overlay == null) {
overlay = createElement(
{
tagName: "iframe",
id: overlayId,
frameBorder: "0",
scrolling: "no",
allowTransparency: "true",
style: {
top: "0px",
left: "0px",
position: "absolute",
filter: "alpha(opacity=100); -moz-opacity:1.0",
zIndex: $getZIndex()
},
width: document.body.scrollWidth,
height: document.body.scrollHeight,
parent: document.body
},
document
);
}
overlay.document.body.bgColor = "#dddddd";
dialog.overlay = overlay;
dialog.style.zIndex = $getZIndex();
dialog.style.position = "absolute";
dialog.style.top = ((document.documentElement.clientHeight - dialog.offsetHeight) / 2 + document.documentElement.scrollTop) + "px";
dialog.style.left = ((document.documentElement.clientWidth - dialog.offsetWidth) / 2 + document.documentElement.scrollLeft) + "px";
overlay.style.display = "";
dialog.style.display = "";
}
};