공지사항 에디터 수정.

강석 최 2022-11-14 10:46:04 +09:00
parent 08cf38065f
commit 082f55756c
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,4 @@
var CrossEditor
$(document).on('click', '#commentSaveBtn', function (){
if(!$("#comment").val()) {
alert("댓글을 입력해주세요.")
@ -94,9 +95,18 @@ function getEditModal(publicKey, publicType){
]
});*/
setUploadDiv();
var CrossEditor = new NamoSE('editor');
CrossEditor = new NamoSE('editor');
CrossEditor.params.ParentEditor = document.getElementById("editor");
CrossEditor.params.Width = "100%";
CrossEditor.params.UserLang = "auto";
CrossEditor.params.NewToolbar = true;
CrossEditor.params.FullScreen = false;
$("#editor").show();
/*CrossEditor.OnInitCompleted(function (e){
e.editorTarget.SetBodyValue(document.getElementById("pe_bhr").value);
})*/
CrossEditor.EditorStart();
$("#editModal").modal('show');
@ -139,6 +149,7 @@ function savePublicBoard(formId, publicType){
if(contentCheck(formId)){
if(confirm("저장하시겠습니까?")){
contentFade("in");
$("#content").val("");
const formData = new FormData($("#"+formId)[0]);
for(const file of files) {
if(!file.isDelete)
@ -147,6 +158,7 @@ function savePublicBoard(formId, publicType){
$(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq"));
})
formData.append('content', CrossEditor.GetBodyValue());
$.ajax({
type : 'POST',
data : formData,
@ -183,3 +195,8 @@ function contentCheck(formId){
flag = fileCheck(flag, files);
return flag;
}
function OnInitCompleted(e){
e.editorTarget.SetBodyValue(document.getElementById("content").value);
}

View File

@ -41,8 +41,9 @@
</div>
<div class="mb-3 row justify-content-center">
<label for="editor" class="col-sm-2 col-form-label text-center">내용</label>
<div class="col-sm-10" id="editor" name='editor'>
<!--<textarea type='hidden' id="content" name='content' th:utext="${info.content}"></textarea>-->
<div class="col-sm-10">
<div id="editor" name='editor'></div>
<textarea id="content" class="d-none" th:utext="${info.content}"></textarea>
</div>
</div>
<div class="row mb-3">