feat: [approval] 양식 선택 시 제목 자동 설정 기능 추가

- applyBodyTemplate에서 제목 필드가 비어있으면 양식명 자동 입력
- create/edit 공통 적용
This commit is contained in:
김보곤
2026-03-04 14:51:18 +09:00
parent 0593700e40
commit aa8ae86f1d
2 changed files with 14 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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;