Skip to content

Commit d7923b2

Browse files
committed
fix some commands links and closing the command dialog
1 parent 26cae9b commit d7923b2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

extensions/star/star.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (l action) Attrs() map[template.HTMLAttr]any {
9797

9898
return map[template.HTMLAttr]any{
9999
method: fmt.Sprintf("/+/star/%s", url.PathEscape(l.page.Name())),
100+
"href": fmt.Sprintf("/+/star/%s", url.PathEscape(l.page.Name())),
100101
}
101102
}
102103

extensions/upload_file/upload.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ func (u Upload) Attrs() map[template.HTMLAttr]any {
1818
link := fmt.Sprintf("/+/upload-file/form?page=%s", url.PathEscape(u.p.Name()))
1919

2020
return map[template.HTMLAttr]any{
21-
"href": link,
22-
"hx-post": link,
21+
"href": link,
22+
"hx-post": link,
23+
"hx-target": "body",
24+
"hx-swap": "beforeend",
2325
}
2426
}
2527

templates/commands.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const commands = () => document.getElementById('commands-modal');
3737

3838
// clicking any link in the commands list executes the command
39-
commands().querySelectorAll('a').forEach( ele => ele.addEventListener('click', evt => commands().close()));
39+
commands().querySelectorAll('a').forEach( ele => ele.addEventListener('click', evt => commands().classList.remove("is-active")));
4040

4141
// Pressing Ctrl+K shows the commands list
4242
document.addEventListener('keydown', e => {

0 commit comments

Comments
 (0)