From f41773f90bf4703aa2423a764b5a96451094d4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Tue, 6 Dec 2022 19:23:10 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/publicBoard/publicBoard.js | 20 +- .../templates/publicBoard/commentDiv.html | 79 ++++--- .../publicBoard/notice/noticeEditModal.html | 6 +- .../publicBoard/notice/noticePage.html | 2 +- .../publicBoard/notice/noticeViewModal.html | 194 ++++++++++-------- 5 files changed, 166 insertions(+), 135 deletions(-) diff --git a/src/main/resources/static/js/publicBoard/publicBoard.js b/src/main/resources/static/js/publicBoard/publicBoard.js index dd9631c1..2ca51dd4 100644 --- a/src/main/resources/static/js/publicBoard/publicBoard.js +++ b/src/main/resources/static/js/publicBoard/publicBoard.js @@ -26,13 +26,13 @@ $(document).on('click', '#commentSaveBtn', function (){ xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); }, success : function(html) { - $("#commentDiv").append(html) const parentComment = $("#parentComment"); - if(parentComment.val()){ - commentFormReset(); - parentComment.val(''); - $("#commentFormHome").append($("#commentForm")) + if(!parentComment.val()){ + $("#commentDiv").append(html) + }else{ + $("#addedCommentHome"+parentComment.val()).append(html); } + commentFormReset(); alert("저장되었습니다."); contentFade("out"); }, @@ -46,11 +46,11 @@ $(document).on('click', '#commentSaveBtn', function (){ }) $(document).on('click', '.childCommentBtn', function (){ - const childCommentDiv = $(this).parents(".commentRow").find(".childCommentDiv") - childCommentDiv.show(); + const childCommentFormDiv = $(this).parents(".commentRow").find(".childCommentFormDiv") + childCommentFormDiv.show(); $("#parentComment").val($(this).parents(".commentRow").find(".commentKey").val()); $("#childFormRemoveBtn").show(); - childCommentDiv.empty().append($("#commentForm")) + childCommentFormDiv.empty().append($("#commentForm")) }) $(document).on('click', '#childFormRemoveBtn', function (){ commentFormReset(); @@ -59,7 +59,7 @@ $(document).on('click', '.deleteCommentBtn', function (){ const commentRow = $(this).parents(".commentRow"); const publicKey = Number(commentRow.find(".publicKey").val()); const commentKey = Number(commentRow.find(".commentKey").val()); - $.ajax({ + /*$.ajax({ type : 'POST', data : JSON.stringify({publicKey: publicKey, commentKey: commentKey}), url : "/publicBoard/deleteComment", @@ -76,7 +76,7 @@ $(document).on('click', '.deleteCommentBtn', function (){ alert("삭제를 실패하였습니다.") contentFade("out"); } - }) + })*/ }) function getEditModal(publicKey, publicType){ diff --git a/src/main/resources/templates/publicBoard/commentDiv.html b/src/main/resources/templates/publicBoard/commentDiv.html index c02bd86d..b0aa019d 100644 --- a/src/main/resources/templates/publicBoard/commentDiv.html +++ b/src/main/resources/templates/publicBoard/commentDiv.html @@ -1,57 +1,68 @@ -
+
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- - -
-
- +
+
+
+ +
+
+ +
+
-
- - +
- +
-
+
+
+
+ +
+
+ + +
+ + +
+
+
+ +
+
-
-
+
+
+ +
+
+ + +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/resources/templates/publicBoard/notice/noticeEditModal.html b/src/main/resources/templates/publicBoard/notice/noticeEditModal.html index f9efbb32..da78cfc1 100644 --- a/src/main/resources/templates/publicBoard/notice/noticeEditModal.html +++ b/src/main/resources/templates/publicBoard/notice/noticeEditModal.html @@ -36,20 +36,20 @@
-
+
-
+
-
+

클릭 또는 드레그하여 파일을 업로드 해주세요. diff --git a/src/main/resources/templates/publicBoard/notice/noticePage.html b/src/main/resources/templates/publicBoard/notice/noticePage.html index d9d74f2b..656c8913 100644 --- a/src/main/resources/templates/publicBoard/notice/noticePage.html +++ b/src/main/resources/templates/publicBoard/notice/noticePage.html @@ -147,7 +147,7 @@