max width for filetree

master
Bel LaPointe 2022-02-16 07:53:27 -07:00
parent 95c560cd23
commit 9923b182f4
3 changed files with 16 additions and 4 deletions

View File

@ -222,7 +222,19 @@ func (server *Server) uiSearchHandler(w http.ResponseWriter, r *http.Request) er
data[i].ID = idsTitles[i][0]
data[i].Title = idsTitles[i][1]
}
return t.Lookup("search").Execute(w, map[string]interface{}{"Results": data})
tree := server.tree()
branches, err := tree.GetRootMeta()
if err != nil {
return err
}
branchesJSON, err := json.Marshal(branches)
if err != nil {
return err
}
return t.Lookup("search").Execute(w, map[string]interface{}{
"Results": data,
"Tree": string(branchesJSON),
})
}
func (server *Server) uiFilesHandler(w http.ResponseWriter, r *http.Request) error {

View File

@ -88,7 +88,7 @@ newlines
ID string
}{
{Title: "title id00", ID: "id00"},
{Title: "title id07", ID: "id07"},
{Title: "title id07 but it's really really really long", ID: "id07"},
{Title: "title id00 / title id10", ID: "id00/id10/id10"},
{Title: "title id00 / title id10 / title id20", ID: "id00/id10/id20"},
},
@ -111,7 +111,7 @@ newlines
"id04": {"Leaf":{"Title":"title id04"},"Branches":{}},
"id05": {"Leaf":{"Title":"title id05"},"Branches":{}},
"id06": {"Leaf":{"Title":"title id06"},"Branches":{}},
"id07": {"Leaf":{"Title":"title id07"},"Branches":{}}
"id07": {"Leaf":{"Title":"title id07 but it's really really really long"},"Branches":{}}
}
}`,
}

View File

@ -17,7 +17,7 @@
padding-right: 1em;
}
</style>
<div class="fullscreen tb_fullscreen">
<div class="fullscreen tb_fullscreen" style="max-width: 25em;">
<details open id="filetree">
</details>
</div>