embed meetus
This commit is contained in:
@@ -62,6 +62,7 @@ interface State {
|
||||
loading: boolean
|
||||
selected: Set<string>
|
||||
collapsed: Set<string> // collapsed folder paths (folders default open)
|
||||
treeCollapsed: boolean // top tree pane collapsed to a bar
|
||||
detailCollapsed: boolean // bottom viewer collapsed to a bar
|
||||
targetKey: string
|
||||
error: string
|
||||
@@ -77,6 +78,7 @@ export const store = reactive<State>({
|
||||
loading: false,
|
||||
selected: new Set<string>(),
|
||||
collapsed: new Set<string>(),
|
||||
treeCollapsed: false,
|
||||
detailCollapsed: false,
|
||||
targetKey: TARGETS[0].key,
|
||||
error: '',
|
||||
@@ -134,6 +136,7 @@ export async function loadTree(): Promise<void> {
|
||||
|
||||
export async function select(path: string): Promise<void> {
|
||||
store.selectedPath = path
|
||||
store.detailCollapsed = false // opening a file expands the viewer
|
||||
store.detail = null
|
||||
const res = await fetch(`/api/detail?path=${encodeURIComponent(path)}`)
|
||||
if (res.ok) store.detail = await res.json()
|
||||
|
||||
Reference in New Issue
Block a user