사진 저장, 삭제후 콜백 함수 수정.

main
jjh 1 year ago
parent 4dbc9384ae
commit 8281a69ad9

@ -407,9 +407,8 @@
}
};
// 사진 저장 콜백
saveFileCallback${pageName} = (resp) => {
let btnTitle = $("#btnAddFile--${pageName}").attr("title");
// 사진 콜백
callbackFile${pageName} = (btnTitle, resp) => {
let showMessage = resp.retMessage.replace(/[S]|[F]/g, btnTitle);
dialog.alert(showMessage);
@ -424,6 +423,7 @@
saveFile${pageName} = (info) => {
if (!info) return;
let btnTitle = $("#btnAddFile--${pageName}").attr("title");
let formData = new FormData(document.getElementById("frmFile--${pageName}"));
for (let key in info) {
@ -445,27 +445,15 @@
, data : formData
, contentType : false
, processData : false
, success : resp => { saveFileCallback${pageName}(resp); }
, success : resp => { callbackFile${pageName}(btnTitle, resp); }
});
}
// 선택 사진 삭제 콜백
removeFileCallback${pageName} = (resp) => {
let btnTitle = $("#btnDeleteFile--${pageName}").attr("title");
let showMessage = resp.retMessage.replace(/[S]|[F]/g, btnTitle);
dialog.alert(showMessage);
// 이미지(사진) 재조회
if (resp.saved) {
refreshImageInfo${pageName}();
}
};
// 선택 사진 삭제
removeFile${pageName} = (target) => {
if (!target) return;
let btnTitle = $("#btnDeleteFile--${pageName}").attr("title");
let fileId = "";
let crdnId = $("#crdnId--${pageName}").val();
@ -490,7 +478,7 @@
ajax.post({
url : wctx.url("/sprt/sprt02/020/removeFile.do")
, data : params || {}
, success : resp => { removeFileCallback${pageName}(resp); }
, success : resp => { callbackFile${pageName}(btnTitle, resp); }
});
}

Loading…
Cancel
Save