탭 전환 메인 구조 단순화
This commit is contained in:
@@ -8,8 +8,9 @@ const logoutBtn = document.getElementById("logout-btn");
|
|||||||
const userBadge = document.getElementById("user-badge");
|
const userBadge = document.getElementById("user-badge");
|
||||||
const currentViewTitle = document.getElementById("current-view-title");
|
const currentViewTitle = document.getElementById("current-view-title");
|
||||||
const navButtons = Array.from(document.querySelectorAll(".header-center [data-view]"));
|
const navButtons = Array.from(document.querySelectorAll(".header-center [data-view]"));
|
||||||
const stages = Array.from(document.querySelectorAll(".main-stage[data-stage]"));
|
|
||||||
const organizationFrame = document.getElementById("organization-frame");
|
const organizationFrame = document.getElementById("organization-frame");
|
||||||
|
const organizationStage = document.getElementById("organization-stage");
|
||||||
|
const emptyStage = document.getElementById("empty-stage");
|
||||||
|
|
||||||
const viewLabels = {
|
const viewLabels = {
|
||||||
ledger: "사업관리대장",
|
ledger: "사업관리대장",
|
||||||
@@ -47,11 +48,15 @@ function setActiveView(view) {
|
|||||||
button.classList.toggle("active", active);
|
button.classList.toggle("active", active);
|
||||||
button.classList.toggle("muted", !active);
|
button.classList.toggle("muted", !active);
|
||||||
});
|
});
|
||||||
stages.forEach((stage) => {
|
const isOrganization = currentView === "organization";
|
||||||
stage.hidden = stage.dataset.stage !== currentView;
|
if (organizationStage) {
|
||||||
});
|
organizationStage.hidden = !isOrganization;
|
||||||
|
}
|
||||||
|
if (emptyStage) {
|
||||||
|
emptyStage.hidden = isOrganization;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentView === "organization" && previousView !== "organization" && organizationFrame) {
|
if (isOrganization && previousView !== "organization" && organizationFrame) {
|
||||||
const frameSrc = organizationFrame.dataset.src || organizationFrame.src;
|
const frameSrc = organizationFrame.dataset.src || organizationFrame.src;
|
||||||
organizationFrame.src = frameSrc;
|
organizationFrame.src = frameSrc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,20 +64,14 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="dashboard-main">
|
<main class="dashboard-main">
|
||||||
<section class="main-stage" data-stage="ledger" hidden>
|
<section id="organization-stage" class="main-stage">
|
||||||
<div class="stage-empty"></div>
|
|
||||||
</section>
|
|
||||||
<section class="main-stage" data-stage="project" hidden>
|
|
||||||
<div class="stage-empty"></div>
|
|
||||||
</section>
|
|
||||||
<section class="main-stage" data-stage="team" hidden>
|
|
||||||
<div class="stage-empty"></div>
|
|
||||||
</section>
|
|
||||||
<section class="main-stage" data-stage="organization">
|
|
||||||
<div class="stage-frame">
|
<div class="stage-frame">
|
||||||
<iframe id="organization-frame" src="/legacy/organization?v=20260325-2" data-src="/legacy/organization?v=20260325-2" title="조직도 메인 화면"></iframe>
|
<iframe id="organization-frame" src="/legacy/organization?v=20260325-2" data-src="/legacy/organization?v=20260325-2" title="조직도 메인 화면"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section id="empty-stage" class="main-stage" hidden>
|
||||||
|
<div class="stage-empty"></div>
|
||||||
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user