MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / switchView

Function switchView

deployments/desktop/static/app.js:495–513  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

493}
494
495function switchView(name) {
496 const targetView = $(name);
497 const targetNav = document.querySelector(`[data-view="${name}"]`);
498 if (!targetView || !targetNav) return;
499 document.querySelectorAll(".view").forEach((view) => view.classList.remove("active"));
500 document.querySelectorAll(".nav-item").forEach((item) => item.classList.remove("active"));
501 targetView.classList.add("active");
502 targetNav.classList.add("active");
503 $("pageTitle").textContent = targetNav.textContent;
504 if (name === "settings") {
505 runAction(refreshSettings);
506 }
507 if (name === "push") {
508 runAction(loadSourceOptions);
509 if (!["queued", "running"].includes(state.dailyTaskStatus)) {
510 runAction(loadLatestPush);
511 }
512 }
513}
514
515function renderUsers(users, preferredUserId = state.userId) {
516 const select = $("userSelect");

Callers 1

bindEventsFunction · 0.85

Calls 2

$Function · 0.70
runActionFunction · 0.70

Tested by

no test coverage detected