diff --git a/src/main/webapp/resources/js/base/base-fims.js b/src/main/webapp/resources/js/base/base-fims.js
index 85654e41..2453c3ca 100644
--- a/src/main/webapp/resources/js/base/base-fims.js
+++ b/src/main/webapp/resources/js/base/base-fims.js
@@ -1,3 +1,58 @@
+/**************************************************************************
+* 동기식 대화상자
+**************************************************************************/
+async function confirm2(msg){
+ return await dialog2(msg, "confirm");
+}
+
+async function alert2(msg){
+ return await dialog2(msg, "alert");
+}
+
+async function dialog2(msg, type){
+ var dlgId = "dlg-" + uuid();
+ var resp = await fetch(wctx.url("/resources/html/dialog.html"));
+ var template = await resp.text();
+ var container = "
{content}
";
+ content = container.replace(/{content}/g, msg);
+ var backdropID = dlgId + "-backdrop";
+ var tmpl = template.replace(/{id}/g, dlgId).replace(/{title}/g, "").replace(/{size}/, "").replace("","");
+ tmpl = tmpl.replace("data-bs-backdrop=\"static\"", "data-bs-backdrop=\"static\" data-bs-keyboard=\"false\"");
+ tmpl = tmpl.replace("text-end hidden","text-end");
+ tmpl = tmpl.replace("btn-primary","btn-primary btn-ok");
+ var dlg = $(tmpl).appendTo("body");
+ if(type == "confirm"){
+ dlg.find(".modal-footer").append('');
+ }
+ dlg.find(".modal-header").remove();
+ dlg.find(".modal-body").html(content).fadeIn();
+ dlg.on("hidden.bs.modal", function() {
+ $("#" + dlgId +",#" + backdropID).remove();
+ });
+ dlg.modal("show");
+ $(".modal-backdrop").each(function() {
+ var backdrop = $(this);
+ if (!backdrop.prop("id")){
+ backdrop.prop("id", backdropID);
+ }
+ });
+
+ setDialogZindex();
+
+ return new Promise(resolve => {
+ dlg[0].querySelector(".btn-ok").addEventListener("click", () => {
+ dlg.modal("hide");
+ resolve(true);
+ });
+ if(type == "confirm"){
+ dlg[0].querySelector(".btn-cancel").addEventListener("click", () => {
+ dlg.modal("hide");
+ resolve(false);
+ });
+ }
+ });
+}
+
/**************************************************************************
* 모달창 z-index 초기화
**************************************************************************/
@@ -40,18 +95,6 @@ function focusOK() {
});
}
-/**************************************************************************
-* 파일 다운로드
-**************************************************************************/
-function downloadFile(filePath, fileName, tempAreaId){
- var a = document.createElement("a");
- a.href = resp.filePath;
- a.download = resp.fileName;
- document.getElementById(tempAreaId).appendChild(a);
- a.click();
- document.getElementById(tempAreaId).removeChild(a);
-}
-
/**************************************************************************
* pdf파일 미리보기 창
**************************************************************************/
diff --git a/src/main/webapp/resources/js/fims/photo-main.js b/src/main/webapp/resources/js/fims/photo-main.js
index 4838f56b..308b0352 100644
--- a/src/main/webapp/resources/js/fims/photo-main.js
+++ b/src/main/webapp/resources/js/fims/photo-main.js
@@ -35,10 +35,10 @@ function settingPhotoMain(pageName, crdnIdElementId, carInfoFunc, carLinkFunc){
});
//편집버튼
- $("#btnEditPhoto--"+pageName).on('click', () => {
+ $("#btnEditPhoto--"+pageName).on('click', async() => {
var checked = $("#displayForExist--"+pageName).find("[name='existPhoto']:checked");
if(checked.length < 1){
- alert("선택된 사진이 없습니다.");
+ await alert2("선택된 사진이 없습니다.");
return;
}
@@ -50,11 +50,11 @@ function settingPhotoMain(pageName, crdnIdElementId, carInfoFunc, carLinkFunc){
);
});
//삭제버튼
- $("#btnDeleteExistPhoto--"+pageName).on('click', () => {
+ $("#btnDeleteExistPhoto--"+pageName).on('click', async() => {
var checked = $("#displayForExist--"+pageName).find("[name='existPhoto']:checked");
if(checked.length < 1){
- alert("선택된 사진이 없습니다.");
+ await alert2("선택된 사진이 없습니다.");
return;
}