refactor(copy): 속성 복사를 ② 형상계획 부재 패널에만 두고 ①에서 제거
- 복사 패널을 ② 부재 패널(다시 생성 아래)로 옮김. ①의 수정 카드에는 없음 - ①의 부재 선택 드롭다운과 관련 코드 제거 (②의 부재 목록을 그대로 사용) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a16ee59da
commit
0dbd66d807
2 files changed
+46
-65
No files matched your search
-16
@@ -656,8 +656,6 @@ let copyItemChoice = new Set<CopyItem>(DEFAULT_COPY_ITEMS);
|
||||
function renderCopyItems(): void {
|
||||
const box = $('cp-items');
|
||||
box.replaceChildren();
|
||||
const select = $<HTMLSelectElement>('cp-member');
|
||||
if (select.options.length === 0) for (const m of MEMBERS) select.appendChild(new Option(m.label, m.id));
|
||||
const items = copyItemsFor(state.member);
|
||||
for (const item of items) {
|
||||
const label = el('label', undefined, 'chk');
|
||||
@@ -674,7 +672,6 @@ function renderCopyItems(): void {
|
||||
box.appendChild(label);
|
||||
}
|
||||
$('cp-none').hidden = items.length > 0;
|
||||
select.value = state.member;
|
||||
}
|
||||
|
||||
function renderCopyTargets(): void {
|
||||
@@ -1082,19 +1079,10 @@ function wireRebarPicking(): void {
|
||||
});
|
||||
}
|
||||
|
||||
/** The 속성 복사 panel sits at the bottom of the 부재별 편집창: the ① edit card, or the ② member panel. */
|
||||
function placeCopyPanel(): void {
|
||||
const host = state.stage === 'plan' ? $('member-regen').parentElement : $('edit-regen').parentElement;
|
||||
if (host) host.appendChild($('copy-panel'));
|
||||
// ① has no 부재 list of its own, so the copy panel carries the selector; ② uses its 부재 list.
|
||||
$('cp-member-row').hidden = state.stage !== 'shape';
|
||||
}
|
||||
|
||||
function setStage(stage: Stage): void {
|
||||
// ① opens on 전체 보기 (default). The button is gone, so 전체 보기 returns each time ① is entered.
|
||||
if (stage === 'shape' && state.stage !== 'shape') state.allView = true;
|
||||
state.stage = stage;
|
||||
placeCopyPanel();
|
||||
// Switching 전체 보기 on or off in ① needs the scene rebuilt for the new layout.
|
||||
if ((allPiers !== null) !== multiSceneOn()) setupScene();
|
||||
if (state.scene) setRebarView(state.scene, stage === 'rebar');
|
||||
@@ -3103,10 +3091,6 @@ $<HTMLButtonElement>('cp-clear').addEventListener('click', () => {
|
||||
renderCopyTargets();
|
||||
renderCopyPreview();
|
||||
});
|
||||
$<HTMLSelectElement>('cp-member').addEventListener('change', (ev) => {
|
||||
state.member = (ev.target as HTMLSelectElement).value as MemberId;
|
||||
renderAll();
|
||||
});
|
||||
$<HTMLInputElement>('cp-regen').addEventListener('change', renderCopyPreview);
|
||||
$<HTMLButtonElement>('cp-apply').addEventListener('click', applyCopyPanel);
|
||||
$<HTMLButtonElement>('sv-save').addEventListener('click', confirmSaveDialog);
|
||||
|
||||
Reference in new issue
Block a user