NET餐厅管理系统前端js-dwz.dialog改变原始层的大小
/**
* 改变原始层的大小
* @param {Object} obj
* @param {Object} dialog
* @param {Object} target
*/
resizeDialog:function(obj, dialog, target) {
var oleft = parseInt(obj.style.left);
var otop = parseInt(obj.style.top);
var height = parseInt(obj.style.height);
var width = parseInt(obj.style.width);
if(target == "n" || target == "nw") {
tmove = parseInt($(dialog).css("top")) - otop;
} else {
tmove = height - parseInt($(dialog).css("height"));
}
$(dialog).css({left:oleft,width:width,top:otop,height:height});
$(".dialogContent", dialog).css("width", (width-12) + "px");
$(".pageContent", dialog).css("width", (width-14) + "px");
if (target != "w" && target != "e") {
var content = $(".dialogContent", dialog);
content.css({height:height - $(".dialogHeader", dialog).outerHeight() - $(".dialogFooter", dialog).outerHeight() - 6});
content.find("[layoutH]").layoutH(content);
$.pdialog.resizeTool(target, tmove, dialog);
}
$.pdialog.repaint(target, {oleft:oleft,otop: otop,tmove: tmove,owidth:width});
$(window).trigger("resizeGrid");
},
close:function(dialog) {
if(typeof dialog == 'string') dialog = $("body").data(dialog);
var close = dialog.data("close");
var go = true;
if(close && $.isFunction(close)) {
var param = dialog.data("param");
if(param && param != ""){
param = DWZ.jsonEval(param);
go = close(param);
} else {
go = close();
}
if(!go) return;
}
if ($.fn.xheditor) {
$("textarea.editor", dialog).xheditor(false);
}
$(dialog).unbind("click").hide();
$("div.dialogContent", dialog).html("");
$("div.shadow").hide();
if($(dialog).data("mask")){
$("#dialogBackground").hide();
} else{
if ($(dialog).data("id")) $.taskBar.closeDialog($(dialog).data("id"));
}
$("body").removeData($(dialog).data("id"));
$(dialog).remove();
},