diff --git a/src/main/resources/static/js/publicBoard/notice.js b/src/main/resources/static/js/publicBoard/notice.js index e8e84803..b1e16b51 100644 --- a/src/main/resources/static/js/publicBoard/notice.js +++ b/src/main/resources/static/js/publicBoard/notice.js @@ -11,5 +11,10 @@ $(document).on('click', '.planTr', function (){ }) $(document).on('click', '#saveBtn', function (){ - savePublicBoard("noticeEditForm") + savePublicBoard("noticeEditForm", "PLB001") +}) + +$(document).on('click', '#editBtn', function (){ + $("#viewModal").modal('hide') + getEditModal($("#viewModalPublicKey").val(), "PLB001") }) \ No newline at end of file diff --git a/src/main/resources/static/js/publicBoard/publicBoard.js b/src/main/resources/static/js/publicBoard/publicBoard.js index c776862c..82d585a8 100644 --- a/src/main/resources/static/js/publicBoard/publicBoard.js +++ b/src/main/resources/static/js/publicBoard/publicBoard.js @@ -64,6 +64,7 @@ $(document).on('click', '.deleteCommentBtn', function (){ } }) }) + function getEditModal(publicKey, publicType){ $.ajax({ url: '/publicBoard/editModal', @@ -121,7 +122,7 @@ function getViewModal(publicKey, publicType){ }); } -function savePublicBoard(formId){ +function savePublicBoard(formId, publicType){ if(contentCheck(formId)){ if(confirm("저장하시겠습니까?")){ contentFade("in"); @@ -143,7 +144,7 @@ function savePublicBoard(formId){ alert("저장되었습니다."); contentFade("out"); $("#editModal").modal('hide'); - getViewModal(result, 'PLB001'); + getViewModal(result, publicType); }, error : function(xhr, status) { alert("저장에 실패하였습니다.")