feat: [approval] 양식 선택 시 제목 자동 설정 기능 추가
- applyBodyTemplate에서 제목 필드가 비어있으면 양식명 자동 입력 - create/edit 공통 적용
This commit is contained in:
@@ -341,6 +341,13 @@ function applyBodyTemplate(formId) {
|
||||
if (!confirm('현재 본문 내용을 양식 템플릿으로 교체하시겠습니까?')) return;
|
||||
}
|
||||
|
||||
// 제목 자동 설정 (비어있을 때만)
|
||||
const titleEl = document.getElementById('title');
|
||||
if (!titleEl.value.trim()) {
|
||||
const formSelect = document.getElementById('form_id');
|
||||
titleEl.value = formSelect.options[formSelect.selectedIndex].text;
|
||||
}
|
||||
|
||||
// 편집기 활성화 후 HTML 삽입
|
||||
const useEditorEl = document.getElementById('useEditor');
|
||||
if (!useEditorEl.checked) {
|
||||
|
||||
@@ -376,6 +376,13 @@ function applyBodyTemplate(formId) {
|
||||
if (!confirm('현재 본문 내용을 양식 템플릿으로 교체하시겠습니까?')) return;
|
||||
}
|
||||
|
||||
// 제목 자동 설정 (비어있을 때만)
|
||||
const titleEl = document.getElementById('title');
|
||||
if (!titleEl.value.trim()) {
|
||||
const formSelect = document.getElementById('form_id');
|
||||
titleEl.value = formSelect.options[formSelect.selectedIndex].text;
|
||||
}
|
||||
|
||||
const useEditorEl = document.getElementById('useEditor');
|
||||
if (!useEditorEl.checked) {
|
||||
useEditorEl.checked = true;
|
||||
|
||||
Reference in New Issue
Block a user