Skip to content

Commit

Permalink
use DOM api
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdc committed Aug 10, 2024
1 parent 89ed58c commit 462b137
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/models/ViewState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,8 @@ export const useViewState = create<ViewState>()((set, get) => ({
}
},
resetFocusFlags(app: App) {
const rootGroups: Record<VT.Identifier, VT.WorkspaceParent> = {};
const workspace = app.workspace as VT.Workspace;
workspace.iterateRootLeaves((leaf: VT.WorkspaceLeaf) => {
const group = leaf.parent as VT.WorkspaceParent;
rootGroups[group.id] = group;
document.querySelectorAll(".vt-mod-active").forEach((el) => {
el.classList.remove("vt-mod-active");
});
for (const id in rootGroups) {
const group = rootGroups[id];
group.containerEl.toggleClass("vt-mod-active", false);
}
},
}));

0 comments on commit 462b137

Please sign in to comment.