');
_this.maskDiv.addClass('MaskDiv');
_this.maskDiv.css({
'penapis': "Alpha(opacity=" ( options.opacity - "0") * 100 ");",
'opacity': options.opacity,
'paparan': 'sekat'
});
$(doc.body).append(_this.maskDiv);
jika (_this.contentDiv) {
$(doc.body).append(_this.contentDiv);
_this.contentDiv.show();
_this.contentDiv.draggable({
pembendungan: "dokumen",
kursor: 'bergerak',
pemegang: ".Dialog_Head"
});
$(_this.maskDiv).on("mousemove", function() {
$("badan").preventScroll();
});
$(_this.maskDiv).on("mouseout", function() {
$("badan").liveScroll();
});
if ($(".cke").length == 0 && $(".Dialog_Body").panjang > 0) {
$(".Dialog_Body").preventOuterScroll();
}
}
};
this.remove = fungsi () {
jika (_this.contentDiv) {
_this.contentDiv.remove();
}
jika (_this.maskDiv) {
_this.maskDiv.remove();
}
$("badan").liveScroll();
};
this.formatPercentNumber = fungsi (nilai, keseluruhan) {
if (isNaN(value) && typeof value === "rentetan") {
jika (value.indexOf("%") !== -1) {
value = (value.replace("%", "") / 100) * whole;
} else if (value.indexOf("px") !== -1) {
value = value.replace("px", "");
}
}
kembalikan Math.ceil(nilai);
};
this.position = fungsi (dialog, dialogBody, minusHeight) {
dialog = dialog || $(".ShowDialogDiv");
jika (dialog[0]) {
var clientWidth = document.documentElement.clientWidth;
var clientHeight = document.documentElement.clientHeight;
var width = _this.formatPercentNumber(dialog.data("position").width, clientWidth) || dialog.width();
var height = _this.formatPercentNumber(dialog.data("position").height, clientHeight) || dialog.height();
lebar = lebar < 300 ? 300 : lebar;
tinggi = tinggi < 450 ? 450 : ketinggian;
$(dialog).css({
"lebar": lebar "px",
"tinggi": ketinggian "px",
"atas": Math.ceil((clientHeight - ketinggian) / 2) "px",
"kiri": Math.ceil((clientWidth - width) / 2) "px"
});
dialogBody = dialogBody || $(".Dialog_Body");
jika (dialogBody[0]) {
tolakTinggi = tolakTinggi || ($(".Dialog_Head").outerHeight() $(".Dialog_Foot").outerHeight());
var dialogBodyHeight = ketinggian - minusHeight;
dialogBody.height(dialogBodyHeight);
}
}
}
}
var createDialogTemplate = fungsi (optionArg, contentHtml, saveBtnClickHandler) {
pilihan var = {
"Tindakan": "",
"Tajuk": "",
"Lebar": "50%",
"Ketinggian": "50%"
};
jika (optionArg) {
untuk (var prop dalam optionArg) {
options[prop] = optionArg[prop];
}
}
var newDialog = $("
");
var DialogHead = $("
").appendTo(newDialog);
$("
").html(options.Action " " options.Title).appendTo(DialogHead);
var DialogClose = $("").appendTo(DialogHead);
var DialogBody = $("").html(contentHtml).appendTo(newDialog);
var DialogFoot = $("