-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSystem.Web.UI.WebControls.DialogBox.debug.js
More file actions
119 lines (112 loc) · 4.01 KB
/
System.Web.UI.WebControls.DialogBox.debug.js
File metadata and controls
119 lines (112 loc) · 4.01 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//=============================================================================
// Jocys.com JavaScript.NET Classes (In C# Object Oriented Style)
// Created by Evaldas Jocys <evaldas@jocys.com>
//=============================================================================
/// <reference path="System.debug.js" />
//=============================================================================
// Namespaces
//-----------------------------------------------------------------------------
// <PropertyGroup>
// <RootNamespace>System.Web.UI.WebControls</RootNamespace>
// <PropertyGroup>
//-----------------------------------------------------------------------------
System.Type.RegisterNamespace("System.Web.UI.WebControls");
//=============================================================================
//=============================================================================
// CLASS: System.Web.UI.WebControls.DialogBox
//-----------------------------------------------------------------------------
System.Web.UI.WebControls.DialogBox = function (prefix, waitMessage, autoOpen) {
/* use jQuery-UI DialogBox */
};
System.Type.RegisterClass("System.Web.UI.WebControls.DialogBox");
System.Web.UI.WebControls.DialogBox.OnClick = function (sender, e) {
var prefixEnd = sender.id.lastIndexOf("_") + 1 + e.Prefix.length;
var prefix = sender.id.substring(0, prefixEnd);
// Dialog status panel.
var statusPanelId = prefix + "StatusPanel";
// Dialog container panel.
var dialogPanelId = prefix + "DialogPanel";
// Dialog holder panel.
var holderPanelId = prefix + "HolderPanel";
// Server buttons.
var acceptButtonId = prefix + "AcceptButton";
var cancelButtonId = prefix + "CancelButton";
// Get DOM objects.
var dialogButton = $('#' + sender.id);
var statusPanel = $('#' + statusPanelId);
var dialogPanel = $('#' + dialogPanelId);
var holderPanel = $('#' + holderPanelId);
var acceptButton = $('#' + acceptButtonId);
var cancelButton = $('#' + cancelButtonId);
// Adjust holder to make sure that DialogBox can be moved all over the page.
holderPanel.css("position", "absolute");
holderPanel.css("top", "0");
holderPanel.css("left", "0");
dialogPanel.dialog({
// Make sure that dialog will be created inside the form.
appendTo: '#' + holderPanelId,
// Disable interaction with parent page while Dialog is open.
modal: true,
autoOpen: false,
closeOnEscape: true,
dialogClass: 'SWUI_BoxShadow',
position: { my: "center", at: "center", of: window },
title: e.title,
width: 'auto',
height: 'auto',
resizable: false,
create: function (event, ui) {
$(".ui-dialog-content").addClass("SWUI_ListViewDialog");
},
//modal: true,
open: function () {
// Hide [x] button.
//$(".ui-dialog-titlebar-close").hide();
},
close: function (event, ui) {
// If triggered by clicking on [x] button or pressing ESC key then...
if (event.originalEvent) {
dialogButton.attr("disabled", null);
}
},
buttons: [
/*{
text: "OK",
class: 'ui-button-blue',
click: function () {
dialogButton.attr("disabled", "disabled");
if (statusPanel.length) {
statusPanel.css("display", "block");
if (typeof waitMessage !== "undefined") {
statusPanel.text(waitMessage);
}
}
if (acceptButton.length) {
acceptButton.click();
} else {
dialogButton.attr("disabled", null);
}
$(this).dialog("close");
}
},*/
{
text: "Close",
class: 'ui-button-blue',
click: function () {
if (cancelButton.length) {
cancelButton.click();
} else {
dialogButton.attr("disabled", null);
}
$(this).dialog("close");
}
}
]
});
dialogButton.attr("disabled", "disabled");
dialogPanel.dialog('open');
event.preventDefault();
};
//==============================================================================
// END
//------------------------------------------------------------------------------