|
|
|
@ -172,11 +172,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- option -->
|
|
|
|
|
<div class="option2_btn">
|
|
|
|
|
<div class="option2_btn" data-ctno= ${item['ct_no']!}>
|
|
|
|
|
<div href="#" class="option"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="comment_text">
|
|
|
|
|
<div class="comment_text" data-ctno= ${item['ct_no']!}>
|
|
|
|
|
${item['comment']!}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -244,13 +244,13 @@
|
|
|
|
|
<!-- 옵션 모달 -->
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<a>
|
|
|
|
|
<a id="edit_reply">
|
|
|
|
|
<div class="edit_icon reply"></div>
|
|
|
|
|
수정하기
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a>
|
|
|
|
|
<a id="delete_reply">
|
|
|
|
|
<div class="delect_icon reply"></div>
|
|
|
|
|
삭제하기
|
|
|
|
|
</a>
|
|
|
|
@ -294,6 +294,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var $ct_no ;
|
|
|
|
|
function fncRemove(e) {
|
|
|
|
|
$(e).parent().remove();
|
|
|
|
|
}
|
|
|
|
@ -350,7 +351,8 @@
|
|
|
|
|
|
|
|
|
|
function insert_reply(){
|
|
|
|
|
var data = {
|
|
|
|
|
bd_no : ${model ['rm']['bd_no']!}
|
|
|
|
|
bd_no : ${model ['rm']['bd_no']!}
|
|
|
|
|
,ct_no : $ct_no
|
|
|
|
|
,comment : $("#reply").val()
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
@ -362,31 +364,46 @@
|
|
|
|
|
Swal.fire({text:"등록되지 않았습니다"})
|
|
|
|
|
},
|
|
|
|
|
success:function(result){
|
|
|
|
|
Swal.fire({text:"처리 되었습니다"})
|
|
|
|
|
var tag ="<div class=\"comment\">";
|
|
|
|
|
tag +=" <div class=\"comment_profile\">";
|
|
|
|
|
tag +=" <!-- profile -->";
|
|
|
|
|
tag +=" <div class=\"profile_cont\">";
|
|
|
|
|
tag +=" <div class=\"profile_img\">";
|
|
|
|
|
tag +=" <img src=\"${URL_ROOT}/m/img/community/community_writer_img.png\" alt=\"프로필 사진\">";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"profile_info\">";
|
|
|
|
|
tag +=" <p>"+result.reply.replyer+"</p>";
|
|
|
|
|
tag +=" <p>"+result.reply.reg_tm+"</p>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <!-- option -->";
|
|
|
|
|
tag +=" <div class=\"option2_btn\">";
|
|
|
|
|
tag +=" <div href=\"#\" class=\"option\"></div>";
|
|
|
|
|
tag +=" <input type='hidden' name='ct_no' vale='"+result.reply.ct_no+"' />";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"comment_text\">";
|
|
|
|
|
tag += result.reply.comment;
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +="</div>";
|
|
|
|
|
$(".community_comment").prepend(tag);
|
|
|
|
|
$("#reply").val('');
|
|
|
|
|
if($ct_no == null) {
|
|
|
|
|
var tag ="<div class=\"comment\">";
|
|
|
|
|
tag +=" <div class=\"comment_profile\">";
|
|
|
|
|
tag +=" <!-- profile -->";
|
|
|
|
|
tag +=" <div class=\"profile_cont\">";
|
|
|
|
|
tag +=" <div class=\"profile_img\">";
|
|
|
|
|
tag +=" <img src=\"${URL_ROOT}/m/img/community/community_writer_img.png\" alt=\"프로필 사진\">";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"profile_info\">";
|
|
|
|
|
tag +=" <p>"+result.reply.replyer+"</p>";
|
|
|
|
|
tag +=" <p>"+result.reply.reg_tm+"</p>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <!-- option -->";
|
|
|
|
|
tag +=" <div class=\"option2_btn\" data-ctno ="+result.reply.ct_no+">";
|
|
|
|
|
tag +=" <div href=\"#\" class=\"option\"></div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +=" <div class=\"comment_text\" data-ctno="+result.reply.ct_no+">";
|
|
|
|
|
tag += result.reply.comment;
|
|
|
|
|
tag +=" </div>";
|
|
|
|
|
tag +="</div>";
|
|
|
|
|
$(".community_comment").prepend(tag);
|
|
|
|
|
} else {
|
|
|
|
|
$(".comment_text").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
ele.innerText = $("#reply").val() ;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
debugger;
|
|
|
|
|
$ct_no = null;
|
|
|
|
|
$("#reply").val('');
|
|
|
|
|
Swal.fire({text:"처리 되었습니다"}) ;
|
|
|
|
|
|
|
|
|
|
$(".option2_btn").on("click", function() {
|
|
|
|
|
$("#option2").toggleClass("open");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -549,6 +566,7 @@
|
|
|
|
|
$("#option1").toggleClass("open");
|
|
|
|
|
});
|
|
|
|
|
$(".option2_btn").on("click", function() {
|
|
|
|
|
$ct_no = this.dataset.ctno;
|
|
|
|
|
$("#option2").toggleClass("open");
|
|
|
|
|
})
|
|
|
|
|
$(".shared_btn").on("click", function() {
|
|
|
|
@ -563,28 +581,64 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#delete_board").on("click", function() {
|
|
|
|
|
$("#option1").removeClass("open");
|
|
|
|
|
Swal.fire({
|
|
|
|
|
text: "게시글을 삭제하시겠습니까?",
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
confirmButtonText: '네',
|
|
|
|
|
cancelButtonText: '취소'
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if(result.dismiss == 'cancel') return;
|
|
|
|
|
location.href = "${URL_ROOT}/m/bf_board/view_bf_delete_board.do?bd_tp=${model ['rm']['bd_tp']!}&bd_no=${model ['rm']['bd_no']!}";
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".star").find("img").click(function(e){
|
|
|
|
|
var index = $(".star").find("img").index( this );
|
|
|
|
|
$("#star").val(index+1);
|
|
|
|
|
$(".star").find("img").each(function(idx, ele){
|
|
|
|
|
if(idx<= index){
|
|
|
|
|
ele.src ="${URL_STATIC_ROOT}/m/img/nutrition/nutrition_babyfood_search_star_on.png";
|
|
|
|
|
}else{
|
|
|
|
|
ele.src ="${URL_STATIC_ROOT}/m/img/nutrition/nutrition_babyfood_search_star.png";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
$("#edit_reply").on("click", function() {
|
|
|
|
|
$("#option2").removeClass("open");
|
|
|
|
|
debugger;
|
|
|
|
|
$(".comment_text").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
$("#reply").val(ele.innerText);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#delete_reply").on("click", function() {
|
|
|
|
|
$("#option2").removeClass("open");
|
|
|
|
|
var index = $(".star").find("img").index( this )
|
|
|
|
|
var ctno = this.dataset.ctno;
|
|
|
|
|
var obj = this;
|
|
|
|
|
Swal.fire({
|
|
|
|
|
text: "게시글을 삭제하시겠습니까?",
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
confirmButtonText: '네',
|
|
|
|
|
cancelButtonText: '취소'
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if(result.dismiss == 'cancel') return;
|
|
|
|
|
var data = {
|
|
|
|
|
bd_no : ${model ['rm']['bd_no']!}
|
|
|
|
|
,ct_no : $ct_no
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'${URL_ROOT}/m/bf_board/ajax_delete_bf_board_comment.do?1=1',
|
|
|
|
|
type:'post',
|
|
|
|
|
data: data,
|
|
|
|
|
dataType:'json',
|
|
|
|
|
error:function(request,status,error){
|
|
|
|
|
Swal.fire({text:"삭제되지 않았습니다"});
|
|
|
|
|
},
|
|
|
|
|
success:function(result){
|
|
|
|
|
$(".option2_btn").each( function(idx,ele) {
|
|
|
|
|
if(ele.dataset.ctno == $ct_no) {
|
|
|
|
|
$(ele)[0].parentNode.parentNode.remove();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Swal.fire({text:"삭제 되었습니다"}) ;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.submit').on('click', function () {
|
|
|
|
|
insert_reply();
|
|
|
|
|