Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
Add: 대댓글 달기, Fix: 모바일 댓글 간격
Browse files Browse the repository at this point in the history
  • Loading branch information
leehj050211 committed Dec 19, 2021
1 parent ecb6924 commit 8f0c55d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
8 changes: 3 additions & 5 deletions public/css/etc/board.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
text-align:left;
transition:.25s;
border-radius:1rem;
cursor:pointer;
}
.comment_item_wrap:hover{
box-shadow:var(--shadow);
Expand Down Expand Up @@ -291,7 +292,7 @@
.post_menu{
padding:5rem 3%;
}
.comment{
.comment_list{
padding:0;
}
.comment_write{
Expand All @@ -301,9 +302,6 @@
padding:1.5rem 3%;
}
.comment_child{
margin-left:1.5rem;
}
.comment_menu{
padding:0 3%;
padding-left:2rem;
}
}
1 change: 1 addition & 0 deletions public/js/etc/board/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const commentDelete = commentIndex => {

const comment_write = (depth, parentIdx) => {
$$('.loading')[0].classList.add("on");
depth = parseInt(depth)+1;
$.ajax({
type:'POST',
data:{
Expand Down
14 changes: 12 additions & 2 deletions views/pages/board.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
<div class="comment_list">
<div class="comment_item" v-for="item in commentTree">
<div class="comment_item_wrap">
<div class="comment_item_wrap" :onClick="`postView.commentFocus=${item.idx};`">
<div class="comment_item_info_wrap">
<div class="left_wrap">
<img :src="`/resource/member/profile_images/profile_${item.memberCode}.png`" onerror="this.src='/resource/member/profile_images/profile_default.png'" alt="" class="user_profile">
Expand All @@ -79,6 +79,11 @@
</div>
<div class="comment_item_content">{{item.comment}}</div>
</div>
<form v-if="commentFocus==item.idx" class="comment_write" method="post" autocomplete="off" :onsubmit="`comment_write(${item.depth}, ${item.idx});return false;`">
<textarea placeholder="댓글" class="post_comment" style="width:100%;height:10rem;" required></textarea>
<br><br>
<input type="submit" name="" value="댓글작성" class="button">
</form>
<tree-item
v-if="isParent"
class="comment_child"
Expand Down Expand Up @@ -157,7 +162,7 @@
<script type="text/x-template" id="comment_item_template">
<div class="comment_item">
<div class="comment_item_wrap">
<div class="comment_item_info_wrap">
<div class="comment_item_info_wrap" :onClick="`postView.commentFocus=${item.idx};`">
<div class="left_wrap">
<img :src="`/resource/member/profile_images/profile_${item.memberCode}.png`" onerror="this.src='/resource/member/profile_images/profile_default.png'" alt="" class="user_profile">
</div>
Expand All @@ -171,6 +176,11 @@
</div>
<div class="comment_item_content">{{item.comment}}</div>
</div>
<form v-if="`${postView.commentFocus}`==item.idx" class="comment_write" method="post" autocomplete="off" :onsubmit="`comment_write(${item.depth}, ${item.idx});return false;`">
<textarea placeholder="댓글" class="post_comment" style="width:100%;height:10rem;" required></textarea>
<br><br>
<input type="submit" name="" value="댓글작성" class="button">
</form>
<tree-item
v-if="isParent"
class="comment_child"
Expand Down

0 comments on commit 8f0c55d

Please sign in to comment.